Opening JNLP File in Java 6 JRE instead of JRE 7
Asked Answered
D

10

15

I have Java 6-based Java Web Start application that I need to open on a Windows machine. The machine has JRE 7 installed, with JRE 6 copied manually to the Program Files folder. The problem is that whenever I want to open the JWS application, it opens using Java 7. Even if I use the javaws executable from JRE 6, some properties still refer to JRE 7 files (I verified this by using javaws -verbose app.jnlp. How can I force JRE 6 just for this application?

Dante answered 6/12, 2012 at 13:41 Comment(3)
Why would you want that? Just being curious - has nothing to do with solution. You could set the "OpenWith"-Setting to the jre6 but that would be for all jnlps then.Millpond
Unfortunately the application has an internal check for Java version, and just quits if it's not being executed under JRE 6. :(Dante
Another example: I'm using an internal application that spectacularly fails the security requirements of Java 8. Opening it in java 7 is a whole lot less work than convincing someone to fix it.Incinerator
W
16

I have Java 6-based Java Web Start application ..How can I force JRE 6 just for this application?

Use an appropriate version attribute in the j2se element.

<resources>
    <!-- Any 1.6 JRE -->
    <j2se version='1.6*'>
    ...
</resources> 

Warning

This solution no longer seems to work for installing earlier versions of the JVM!

The best reason I can think of for why it would fail to work is that Oracle is tiring of releasing security updates for earlier Java versions - so is forcing every user to use the latest JVM.

Westberg answered 7/12, 2012 at 8:4 Comment(3)
The original JNLP had 1.6+. I don't know why, when the application itself checks for version and quits if it's not 1.6 anyway. Changing JNLP to 1.6* did the trick.Dante
Glad you got it sorted. :)Westberg
I think it stopped working because Oracle removed the JRE auto-download feature from Web Start in 2013: openjdk bug 8006701. Web Start now often (but not always) silently ignores the version specification.Molluscoid
L
14

I realize this is the oldest post ever, but it came up when I searched for a similar problem. Easiest way to deal with this (as a one time solution that won't affect the system overall) is to install a parallel older version of Java, and drag the jnlp on to the javaws.exe. (I had a web app that used Java 5 and wouldn't open otherwise)

Libove answered 21/8, 2014 at 13:44 Comment(0)
S
4

I have an UAC controlled laptop with Windows 7 and two Java versions installed (1.8 and 1.7). The sesWebstart.jnlp has to be started with the older Java version, in my case 1.7. This worked for me: In the Java Control Panel, delete all entries for the application sesWebstart.jnlp (if exists). You can start the Java Cache Viewer in the command line:

C:\Program Files (x86)\Java\jre1.7.0_55\bin> javaws -viewer

The command starts the Java Control Panel and the Java Cache Viewer. Goto the Java Cache Viewer, select the application list and delete the entry for sesWebstart.jnlp (if exists).

Close the Java Cache Viewer an goto the Java Control Panel. Goto the Settings of the temporary internet files and delete the cache files and the application itself. After that, close the Java Control Panel.

Create a new batch file, that will start the sesWebstart.jnlp with the correct Java (the older one):

"C:\Program Files (x86)\Java\jre1.7.0_55\bin\javaws.exe" "D:\Users\christian\Desktop\sesWebstart.jnlp" 

Now, the sesWebstart Applet can start by executing this batch file.

Snipes answered 21/9, 2015 at 8:42 Comment(0)
S
3

Another plausible solution that worked for me was to rename the javaws.exe(javaws2) program file of the most recent JRE/JDK since JVM always search for the newest version installed. If you need to rollback changes, just rename again to the original value

Salesgirl answered 13/5, 2016 at 17:35 Comment(1)
This is a very good hint. Even using javaws from an earlier version, in the end java appears to execute the program with the most recent javaw.exe. The -verbose option allows to detect this kind of issues. Then, renaming is not a real solution, but allows to understand what happens. I guess the long term solution in this case is the JAVA_HOME, as other answers mentioned.Baskerville
C
1

Just explicitly use the javaws.exe from the JRE you want, like this:

C:\Program Files\Java\jdk1.6.0_45\jre\bin\javaws.exe file.jnlp

But please have other answers in mind, like j2se version setting and jnlp spec.

Cinchonidine answered 30/4, 2014 at 13:26 Comment(3)
I wonder why this one is downvoted, other answers seem to be the same?Squireen
It doesn't actually work. It'll still jump onto another one.Phonon
i tried this one, it is supposed to launch the application but nothing happensMinnich
E
1

I would advise also adding the -verbose flag. e.g. javaws.exe -verbose http....

In my case, I was still invoking some java1.8 arguments (see screenshot), so I had to also disable Java 8 in the Java control panel.

Elixir answered 10/11, 2016 at 5:7 Comment(0)
M
1

Jnlp jre settings are under Java settings which is in Control Panel.

Go to Control Panel and search "Java". In my case it is Java (32-bit). Open it and select Java tab, then Java Application Runtime Settings

Multipartite answered 17/3, 2017 at 7:8 Comment(0)
S
0

you have to do in manually by doing following simple process,

  1. right click on jnlp file --> propeties. go to attribute opens with --> click on change button.
  2. select browse.
  3. choose path of javaws.exe of JRE version that you want whether 6 ot 7. ex. C:\Program Files (x86)\Java\jre7\bin\javaws.exe (in my case)
Sign answered 6/12, 2012 at 13:49 Comment(2)
Thanks, but it didn't allow me to change to a different jawaws. It kept leaving only default one in the Open With window. I eventually renamed the JRE6 one to jawaws2 and then I got it in Open With. However, it still didn't work.Dante
You can change your jnlp file spec tag - <jnlp spec="6.0+" codebase="abc.com" >Sign
L
0

I had the exact same problem. I created a bat file that changes the JAVA_HOME variable, then uses javaws to run the jnlp file and it worked for me.

Contents of the bat file:

SET "JAVA_HOME=[path to your jre folder]"
javaws [path to your jnlp]

Hope it helps :)

Lampley answered 9/11, 2016 at 10:20 Comment(0)
R
0

Just drag link of jnlp file over appropriate version of javaws and it "Open with"picture how to open jnlp with javaws MacOS users usually open files the same way

Rollet answered 11/10, 2017 at 8:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.