Thursday, April 12, 2012

How to run .jnlp Java Web Start JWS apps with OpenJDK Java on Linux and Firefox

In the Windows world, Java Web Start apps run "automagically". That is, if you install Java, that' s all there is to it.


 The Sun/Oracle Java Runtime install takes care of installing the Java runtime, the Java plug-in (for all browsers on the system), and also the required bits to run Java Web Start (javaws.exe). So when you click on a .jnlp link on a web page to launch a Java desktop application, the app just starts, you se the Java splash screen, and seconds later, the app pops up.

(If it is the first time you run an app from such vendor, a security dialog comes up asking if you know and want to trust that developer and its cryptographic signature from that dev going forward, or just authorize it this time, or cancel -not run it-).

In the Linux world, Java (as the GPL Open Source project it now is) is called "OpenJDK". But if you install OpenJDK alone, you don' t get the "Plug-in" (the component needed to run applets inside a web browser AND Java Web Start apps).

For that, -the Java Plug-in- you need "IcedTea" which is the name given to the Java Plug-in that goes along with OpenJDK.

Why they choose to confuse the user with two different package names is beyond me (actually, I know why, it has to do with the project's history, but that' s of no interest to end users). If you ask me, Icedtea should be renamed to "OpenJDK-plugin".

But that is besides the point.

Having said that, -please have patience- here' s the solution to run Java .jnlp on Firefox on Linux.

1. You need to install "Icedtea".
OK, so you installed Icedtea, clicked on a Java Wesbtart app launcher link (.jnlp) and got an odd dialog from the browser asking what do you want to do with the .jnlp file?.



Don' t despair. That happens because while you have:.

1. A functioning JRE installed (OpenJDK)
2. A functioning Java plug-in (IcedTea) installed,

... that the Icedtea installation has NOT configured Icedtea as a browser "helper app" to appropiately launch JNLP files.

So how do you fix it?!??!?! Simple: ;-)

1. Select "Open With" and instead of the default app (ie Fedora wants to open .jnlp links with gEdit), click on the app name to "choose another"
2. Then navigate to /bin and select "javaws'
3. Select "Do this automatically for files like this from now on"
4. Click "OK"

...the Java app will launch.



And from that point on, all Java Web Start apps will run when you click on the launcher link.

(again, the first time you run any given app you' ll have to authorize it, but not from that point onwards if the crypto signature is maintained).


Does this need to be so irritatingly complex? of course not.

The problem is that the Icedtea developers think about things like developers, not end users. :-(

FC
PS:Oh, did I mention my favorite Java Web Start apps? There's a lot, but you should start by taking a look at http://ho.io/mu-commander and http://ho.io/JShot