0

I use Debian. I've installed Java 8 and later Java 6, using scripts available on http://ppa.launchpad.net/webupd8team/java/ubuntu.

I run an app which mus use Java 6. The file.pl contains such a part:

<resources>
<j2se version="1.6.0+" href="http://java.sun.com/products/autodl/j2se" 
initial-heap-size="128M" max-heap-size="400M"/>

I invoke javaws from the Java 6 folder. I see the splash for a while and stops (I get prompt in my console, nothing else happens). I've adjusted my env variables to be sure that the problem isn't there. Some details:

➜  java-6-oracle set | grep jvm
DERBY_HOME=/usr/lib/jvm/java-6-oracle/db
J2REDIR=/usr/lib/jvm/java-6-oracle/jre
J2SDKDIR=/usr/lib/jvm/java-6-oracle
JAVA_HOME=/usr/lib/jvm/java-6-oracle
OLDPWD=/usr/lib/jvm/java-6-oracle/jre
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/lib/jvm/java-6-oracle/bin:/usr/lib/jvm/java-6-oracle/db/bin:/usr/lib/jvm/java-6-oracle/jre/bin
PWD=/usr/lib/jvm/java-6-oracle
path=( /usr/local/bin /usr/bin /bin /usr/local/games /usr/games /usr/lib/jvm/java-6-oracle/bin /usr/lib/jvm/java-6-oracle/db/bin /usr/lib/jvm/java-6-oracle/jre/bin )

➜  java-6-oracle ./jre/javaws/javaws -verbose ~/file.pl
Java(TM) Web Start 1.6.0_45 Launching: /usr/lib/jvm/java-8-oracle/jre/bin/java
/usr/lib/jvm/java-8-oracle/jre/bin/java
 -Xbootclasspath/a:/usr/lib/jvm/java-6-oracle/jre/lib/javaws.jar:/usr/lib/jvm/java-6-oracle/jre/lib/deploy.jar:/usr/lib/jvm/java-6-oracle/jre/lib/plugin.jar
 -classpath
 /usr/lib/jvm/java-6-oracle/jre/lib/deploy.jar
 -Djava.security.policy=file:/usr/lib/jvm/java-6-oracle/jre/lib/security/javaws.policy
 -DtrustProxy=true
 -Xverify:remote
 -Djnlpx.home=/usr/lib/jvm/java-6-oracle/jre/bin
 -Dsun.awt.warmup=true
 -Djnlpx.origFilenameArg=/home/me/file.pl
 -Djnlpx.remove=true
 -Djnlpx.splashport=38511
 -Djnlpx.jvm=/usr/lib/jvm/java-8-oracle/jre/bin/java
 com.sun.javaws.Main
 /tmp/javawMxZTga

I see that the incorect jvm version is invoked. Why is it so?

EDIT: It's not a duplicate of Webstart runs with wrong version of JRE I don't run the program using a browser. Both my Javas are 64-bit.

1 Answers1

1

The problem is this ugly j2se version tag. It defines that the parameters are used for a certain JVM version but also which versions are allowed at all. You defined 1.6.0+ which allows any after java 6. If you want to limit it to 1.6 you might use "1.6*".

See also How to specify a JRE range in jnlp file?

brummfondel
  • 1,202
  • 1
  • 8
  • 11
  • Nothing has changed. I typed "1.6*" there. This version of the jnlp file is used among my colleagues using Windows, successfully. They just make sure to run the proper version of javaws, in case they have newer versions available. – Dawid Łakomy Dec 15 '17 at 14:11
  • You didn't mention that this is only on Linux. Linux uses IcedTea for Webstart if OpenJDK is used (which is only available version for Java 6). IcedTea Webstart has many bugs and is not completely compatibel with Oracle Webstart. – brummfondel Dec 16 '17 at 18:25
  • I don't use any browser. I invoke using a terminal, as I've written. – Dawid Łakomy Dec 18 '17 at 09:49
  • I didn't write anything about a browser at all. You typed "javaws" which is Java Webstart. – brummfondel Dec 19 '17 at 11:55
  • Sorry, I misunderstood IcedTea as a browser name. I use Oracle WS. – Dawid Łakomy Dec 19 '17 at 13:16
  • There is no Oracle WS for Java 6! You are using IcedTea. Oracle Java might not find the openJDK WS of Java 6. Installing OpenJdk 8 might help and find WS of Java 6. If not there is no solution without removing Java 8 (why is this no option?) – brummfondel Dec 21 '17 at 10:45
  • As far as I know there is included in JRE since release of Java 5.0. I use JRE from official Oracle website. I thought that the path to the java folder indicates it. I don't use OpenJRE/JDK. Removing (or disabling) Java 8 would work, but it's a workoround. Disabling newer Java, that runs all the soft I use apart from this one, isn't a solution. – Dawid Łakomy Dec 21 '17 at 12:27
  • Requiring an old expired java version is not a solution either. – brummfondel Dec 22 '17 at 12:20
  • I agree. This software should be rewritten, but unfortunately it's not my decision. – Dawid Łakomy Dec 22 '17 at 13:53