Java – wsimport out of memory issues in Java 1.6

javawsimport

I'm using wsimport in Java 1.6 (i.e. build 1.6.0-b105) on Windows XP 5.1 and I'm getting a out of memory exception. I used to JConsole and it seems wsimport process is maxing out at 64 MB. How can I increase the heap memory for wsimport?

Thanks,

Best Answer

For me setting environment variable WSIMPORT_OPTS (suggested in another answer, and apparently working in older versions of wsimport) does not seem to have any effect.

For me the following does work: instead of wsimport use

java -classpath $JAVA_HOME/lib/tools.jar com.sun.tools.internal.ws.WsImport

where $JAVA_HOME is the JDK (not JRE) root folder.

On this Java command line you can then add whatever JVM options you want. (I needed -Djavax.net.debug=all for SSL trust debugging.)

(I'm using Ubuntu with OpenJDK 6, package version 6b20-1.9.7-0ubuntu1.)