Opening JNLP File in Java 6 JRE instead of JRE 7

2019-01-22 20:58发布

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?

10条回答
做个烂人
2楼-- · 2019-01-22 21:18

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 :)

查看更多
放荡不羁爱自由
3楼-- · 2019-01-22 21:20

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

查看更多
叛逆
4楼-- · 2019-01-22 21:22

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.

查看更多
Bombasti
5楼-- · 2019-01-22 21:23

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.

查看更多
何必那么认真
6楼-- · 2019-01-22 21:26

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

查看更多
手持菜刀,她持情操
7楼-- · 2019-01-22 21:28

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

查看更多
登录 后发表回答