Associating JNLP files on Gnome 3

Associating JNLP files on Gnome 3

On Gnome 3, the support for mimetypes is more better than compared with old Gnome 2. Now we have a mimetype repository for all files types, where we can easily customize rules to manage apps per files, or files per apps (too!).

Java WEB (Java WEB Start) apps use JNLP or JSP files to open him on client browsers and desktops, the problem starts when we try to open these files on file explorer, they always open on our browsers (Chrome, Firefox, etc.) by default. To change this, we need to do few changes by terminal. Then, follow these steps:

Access the managed mimetypes folder:

Then, create a new file to associate your javaws command with JNLP files. This step requires sudo permission.

Ok, now put this content in this file:

Pay attention to this line:

You’ll put the location of your javaws executable at JVM folder. On Ubuntu-based distros the installation folder always is at /usr/lib/jvm/.

Now, we need registry this new configuration for gnome mimetypes manager. To do this, do this:

At the end of this file, put a new entry referring your previous file ‘javaws.desktop’, like this:

Save and close the file.

Now, you can test across browser or your favorite file explorer.

Blog Linux