Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug Java Web Start applications?

I have a Java Web Start Application that I launch from live site by downloading a tailored JNLP file.

The problem is that once the Java Web Start application has loaded, the application quits without any warning. I know that the certificate is OK since when I enable "Show site certificate from server even if it is valid" option from Java settings, it displays a message correspondigly.

I have tried enabling all debugging settings from Java settings ("Enable tracing", "Enable logging", "show applet lifecycle exceptions") and also Java console, but with no luck caching the problem.

Could anyone with more experience on Java Web Start development/debugging give any tips?

like image 697
jsalonen Avatar asked Mar 01 '10 21:03

jsalonen


People also ask

How do I start the Java program in debug mode?

Enable JVM DebuggingClick Java > JVM Settings tab. Under Debug Java Settings, select the Enable Debug checkbox. Provide JVM options as necessary by clicking the New button. If you substitute suspend=y, the JVM starts in suspended mode and stays suspended until a debugger attaches to it.

How do I debug a JNLP file?

jnlp file with verbose tracing, perform the following steps: Enable tracing in the local JRE control panel. Go to Java Control Panel > Advanced > Debugging and select the Enable tracing option. Run the command: <JRE_HOME>/bin/javaws -verbose <downloaded jnlp file path> .

How do I debug a Java program remotely?

Go to the eclipse menu and select Run->Debug Configuration; it opens Debug Configuration setup. On the Debug configuration window, create a new “Remote Java Application” configuration. Select the project to be debugged and give it a Name. Select connection type, Socket Attach, or Socket Listen.


1 Answers

You can launch a Web Start program form the command line using javaws, and pass JVM options with the -J flag.

Use a debugger to connect to that process:
http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/troubleshooting.03.06.html

like image 92
Mark Bolusmjak Avatar answered Oct 19 '22 01:10

Mark Bolusmjak