Search code examples
javajava-web-start

Launching a browser window from Java WebStart (JNLP) in Java 6u13+


There is a bug in Java 6u13 and 6u14. https://bugs.java.com/bugdatabase/view_bug?bug_id=6835450

Simply put, the following code is supposed to open a browser window, but because of a bug in the framework, it stopped working in Java 1.6 update 13. Nothing opens anymore. There was a similar bug for Java applets (that was fixed in update 14), but this one still exists in update 14 for Java WebStart/JNLP.

getAppletContext().showDocument(new URL("http://www.sun.com"),"_blank");

Do you know of any workarounds?


Solution

  • I've not tried it in JNLP, but normally this should work:

    java.awt.Desktop.getDesktop().browse(new URI("http://www.sun.com"));