Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I debug applications under Java Web Start (JNLP)?

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

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

like image 865
Horcrux7 Avatar asked Mar 26 '09 14:03

Horcrux7


People also ask

How do I associate a JNLP file with Java Web Start?

Highlight the JNLP file by tapping or clicking . JNLP under the Extensions column, then tap or click on Change Program. Tap or Click Java™ Web Start Launcher from the list of programs. If you do not see Java Web Start Launcher listed, tap or click More options then Look for another app on this PC.

What is Java JNLP file?

The JNLP file specifies the name of the main JAR file, the version of Java Runtime Environment software that is required to run the RIA, name and display information, optional packages, runtime parameters, system properties, and so on.


2 Answers

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 then connect to the given port. In Java webstart 6.0 this can be done with the -J option, in earlier version via environment variable JAVAWS_VM_ARGS. See details here.

like image 133
Kai Huppmann Avatar answered Sep 22 '22 02:09

Kai Huppmann


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 
like image 26
mkoeller Avatar answered Sep 22 '22 02:09

mkoeller