views:

2333

answers:

4

I know how I can debug a remote Java VM with Eclipse. Bit how can I do it with a Java Web Start program. I have a problem that only occur in Java Web Start. It must be security related.

I need a solution that work with a current Java VM like 1.6.0_12.

+1  A: 

I recently wrote a blog article explaining how to do this. The solution involves setting the JAVAWS_VM_ARGS environment variable to include the JVM debug switches.

Dan Dyer
This seems not to work with Java 6 or it is a Vista problem.
Horcrux7
+2  A: 

It's quite the same like with any other Java process you want to debug remotely: You have to set up some arguments for the VM ( -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=n,suspend=y,address=12345 ) and the connect to the given port. In webstart 6.0 this can be done with the -J option, in earlier version via environment variable JAVAWS_VM_ARGS. See details here.

Kai
A: 

Have you tried printing a debug log? That is a useful thing to have at any rate, and might help in this case.

If you want real debugging, see e.g. here: How can I debug under WebStart?

sleske
+2  A: 

Start the JWS VM manually. This way you can provide the startup parameters to open the debug port. Here is a description, it goes like this:

set JAVAWS_TRACE_NATIVE=1
set JAVAWS_VM_ARGS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket, address=8989,server=y,suspend=n"
javaws http://server:port/descriptor.jnlp
mkoeller