How to make java web start launch automatically without double click on the JNLP [duplicate]
Asked Answered
I

1

12

I have a java applet application which is accessed by our customers through our website. Since Microsoft edge and chrome stopped supporting java plug in, we converted the applet to be launched through JNLP and Java Web Start, Unfortunately, In both browsers the JNLP downloaded and the customer should double click the file in order to launch a Java Web Start.

Our customers totally disappointed from this behavior, And I'm trying to find a solution for this issue.

Inane answered 4/4, 2016 at 6:30 Comment(3)
Does the server provide the correct content-type for a JNLP?Legacy
Yes, Andrew....The server provides the the correct content-type for JNLP, but currently Java Web Start not starting from Microsoft Edge or Google chrome, And the answer you provide for the https://mcmap.net/q/705996/-auto-launch-jnlp-on-click is valid for that period (2011) but not working now.Inane
Did you find a solution I am in 2018 for chrome and others and I have this problem. Thanks.Hemicycle
R
11

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.

  1. close Chrome, and keep in mind to always make a copy of the files altered in the next steps ;-)
  2. find in the Chrome library chrome.[so|dll] the bytes jnlp and patch them as e.g. jnl-
  3. 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.

Razid answered 4/4, 2016 at 7:49 Comment(7)
how can I apply the first point, regarding the example you have mentioned, it's not working from oracle website. moreover, I'm looking for running the Jave Web Start directly, I don't need the customer to see any change, just click on the link and everything will run exactly as he/she run an applet.Inane
@Inane Sorry my fault. Did not pay enough attention for the browsers in question. I amend my answer at least for Chrome. For Microsoft Edge I can't help, don't have it.Razid
@Inane Not a real solution for your customers, but maybe you are anyway interested. Have a look to the "hacky solution" in my answer.Razid
Thank you very much for your cooperation, but as you said this is totally not a solution for my customers. but really I appreciate your effort for helpingInane
How to extract the bytes of the chrome.dllInane
@Inane I did it manually using a binary(aka. hex)-editor.Razid
Sorry I have nor try this solution. But is is the most practical, real solution, with actual version of chrome? Thanks in advance.Hemicycle

© 2022 - 2024 — McMap. All rights reserved.