Possible solutions
1) Change the behavior in the browser to ask the user what to do when he click on a JNLP link
. Then the user can select Open with: Java web start launcher
or save file
.
edit It's working in Firefox but it doesn't work with Chrome: see related bug reports 10877 and the open issues
2) Provide a script to the user which executes
javaws https://example.com/your_application.jnlp
An example for demonstration (application link taken from Oracle tutorial: Running a Java Web Start Application)
javaws https://docs.oracle.com/javase/tutorialJWS/samples/deployment/NotepadJWSProject/Notepad.jnlp
This will open a simple Java application.
edit For the fearless there is a hacky solution for Chrome.
- close Chrome, and keep in mind to always make a copy of the files altered in the next steps ;-)
- find in the Chrome library
chrome.[so|dll]
the bytes jnlp
and patch them as e.g. jnl-
- find in your Chrome user profile directory the file
Preferences
and amend it as ...
.
"download": {
...
"extensions_to_open": "jnlp",
...
},
Next time you click on a link to a JNLP file it will be opened automatically (with the application which is assigned to open this file type, normally it's javaws
).
The property was found after having a look into the source pref_names.cc. But Chrome treat the extension jnlp
as dangerous that's why we need to patch the library as well.