Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Oracle JRE 9 not recognized #43

Closed
dtuma opened this issue May 24, 2017 · 8 comments
Closed

Oracle JRE 9 not recognized #43

dtuma opened this issue May 24, 2017 · 8 comments
Assignees
Labels
Milestone

Comments

@dtuma
Copy link

dtuma commented May 24, 2017

Java 9 is scheduled for release in July 2017. It includes JEP 223, which changes the version numbering scheme of the Java platform: http://openjdk.java.net/jeps/223

The version extraction and comparison logic in universalJavaApplicationStub is not working against the new version numbers. As a result, a user with Java 9 installed may receive an error stating that no suitable Java version was found.

@tofi86 tofi86 added the bug label May 25, 2017
@tofi86 tofi86 added this to the Version 2.0.3 milestone May 25, 2017
@tofi86 tofi86 self-assigned this May 25, 2017
@tofi86
Copy link
Owner

tofi86 commented May 25, 2017

Oh screw you, Oracle! 😡

Thanks @dtuma David for reporting this. I will take a look and change the version comparison logic asap.

@tofi86
Copy link
Owner

tofi86 commented May 27, 2017

The current JRE 9-ea build identifies as:

→ /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+171)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+171, mixed mode)

And the current JDK 9-ea build:

→ java -version
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+171)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+171, mixed mode)

and it registers as:

→ /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
    9, x86_64:	"Java SE 9-ea"	/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
    1.8.0_121, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
    1.7.0_79, x86_64:	"Java SE 7"	/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home

Requesting a specific java version:

→ /usr/libexec/java_home -v 9
/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home

→ /usr/libexec/java_home -v 8+
/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home

→ /usr/libexec/java_home -v 8
Unable to find any JVMs matching version "8".
/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home

→ /usr/libexec/java_home -v 1.8
/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home

→ /usr/libexec/java_home -v 1.9
Unable to find any JVMs matching version "1.9".
/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home

→ /usr/libexec/java_home -v 1.8+
/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home

So compatibility with old Java/JDK versions must be achieved by requesting 1.8+ in the JVMVersion plist key instead of "new" syntax 8+

Oh man, Oracle opened the next gate to hell... Really don't want to know how many apps this change is going to break...

@tofi86
Copy link
Owner

tofi86 commented Jun 11, 2017

Hi @dtuma, took a bit longer than expected, sorry...
Finished it on my last day before my vacation though... Please test the current version from the develop branch, it should support Java 9-ea perfectly well.

If you want to set a Java Version Requirement in the Plist file, please note that you have to use the following schema (noted in regex syntax):

  • 1.(6|7|8)(+|*)?
  • (9|10|11)(+|*)?

If you're having trouble or if you think something is broken with the Java 9 support with my latest changes, please report back here...


Note: I added extensive tests in test/java-version-tester.sh for the changed functions used to retrieve and compare the Java version (string) and Java requirement string.

This is an example output:

→ ./java-version-tester.sh 

########################################################
Testing function extractJavaMajorVersion()

Tests with Java 1.6:
[TEST OK] Extracted Java major version '6' for Java '1.6.0'
[TEST OK] Extracted Java major version '6' for Java '1.6.0_07'
[TEST OK] Extracted Java major version '6' for Java '1.6.0_45'

Tests with Java 1.7:
[TEST OK] Extracted Java major version '7' for Java '1.7.0'
[TEST OK] Extracted Java major version '7' for Java '1.7.0_09'
[TEST OK] Extracted Java major version '7' for Java '1.7.0_79'

Tests with Java 1.8:
[TEST OK] Extracted Java major version '8' for Java '1.8.0'
[TEST OK] Extracted Java major version '8' for Java '1.8.0_05'
[TEST OK] Extracted Java major version '8' for Java '1.8.0_91'
[TEST OK] Extracted Java major version '8' for Java '1.8.0_131'

Tests with Java 9:
[TEST OK] Extracted Java major version '9' for Java '9-ea'
[TEST OK] Extracted Java major version '9' for Java '9.0.1'
[TEST OK] Extracted Java major version '9' for Java '9.0.23'
[TEST OK] Extracted Java major version '9' for Java '9.10.120'

Tests with Java 10:
[TEST OK] Extracted Java major version '10' for Java '10-ea'
[TEST OK] Extracted Java major version '10' for Java '10.0.1'
[TEST OK] Extracted Java major version '10' for Java '10.0.23'
[TEST OK] Extracted Java major version '10' for Java '10.10.120'


########################################################
Testing function JavaVersionSatisfiesRequirement()

Tests with Java 1.6:
[TEST OK] [0==0] Java version 1.6 satisfies requirement 1.6
[TEST OK] [0==0] Java version 1.6 satisfies requirement 1.6+
[TEST OK] [0==0] Java version 1.6 satisfies requirement 1.6*
[TEST OK] [2==2] Invalid Java version requirement 1.6.0_45
[TEST OK] [1==1] Java version 1.6 does not satisfy requirement 1.7
[TEST OK] [1==1] Java version 1.6 does not satisfy requirement 1.7+
[TEST OK] [1==1] Java version 1.6 does not satisfy requirement 1.7*
[TEST OK] [2==2] Invalid Java version requirement 1.7.0_71
[TEST OK] [1==1] Java version 1.6 does not satisfy requirement 1.8
[TEST OK] [1==1] Java version 1.6 does not satisfy requirement 1.8+
[TEST OK] [1==1] Java version 1.6 does not satisfy requirement 1.8*
[TEST OK] [2==2] Invalid Java version requirement 1.8.0_121
[TEST OK] [1==1] Java version 1.6 does not satisfy requirement 9
[TEST OK] [1==1] Java version 1.6 does not satisfy requirement 9+
[TEST OK] [1==1] Java version 1.6 does not satisfy requirement 9*
[TEST OK] [1==1] Java version 1.6 does not satisfy requirement 9.1.2

Tests with Java 1.7:
[TEST OK] [1==1] Java version 1.7 does not satisfy requirement 1.6
[TEST OK] [0==0] Java version 1.7 satisfies requirement 1.6+
[TEST OK] [1==1] Java version 1.7 does not satisfy requirement 1.6*
[TEST OK] [2==2] Invalid Java version requirement 1.6.0_45
[TEST OK] [0==0] Java version 1.7 satisfies requirement 1.7
[TEST OK] [0==0] Java version 1.7 satisfies requirement 1.7+
[TEST OK] [0==0] Java version 1.7 satisfies requirement 1.7*
[TEST OK] [2==2] Invalid Java version requirement 1.7.0_71
[TEST OK] [1==1] Java version 1.7 does not satisfy requirement 1.8
[TEST OK] [1==1] Java version 1.7 does not satisfy requirement 1.8+
[TEST OK] [1==1] Java version 1.7 does not satisfy requirement 1.8*
[TEST OK] [2==2] Invalid Java version requirement 1.8.0_121
[TEST OK] [1==1] Java version 1.7 does not satisfy requirement 9
[TEST OK] [1==1] Java version 1.7 does not satisfy requirement 9+
[TEST OK] [1==1] Java version 1.7 does not satisfy requirement 9*
[TEST OK] [1==1] Java version 1.7 does not satisfy requirement 9.1.2

Tests with Java 1.8:
[TEST OK] [1==1] Java version 1.8 does not satisfy requirement 1.6
[TEST OK] [0==0] Java version 1.8 satisfies requirement 1.6+
[TEST OK] [1==1] Java version 1.8 does not satisfy requirement 1.6*
[TEST OK] [2==2] Invalid Java version requirement 1.6.0_45
[TEST OK] [1==1] Java version 1.8 does not satisfy requirement 1.7
[TEST OK] [0==0] Java version 1.8 satisfies requirement 1.7+
[TEST OK] [1==1] Java version 1.8 does not satisfy requirement 1.7*
[TEST OK] [2==2] Invalid Java version requirement 1.7.0_71
[TEST OK] [0==0] Java version 1.8 satisfies requirement 1.8
[TEST OK] [0==0] Java version 1.8 satisfies requirement 1.8+
[TEST OK] [0==0] Java version 1.8 satisfies requirement 1.8*
[TEST OK] [2==2] Invalid Java version requirement 1.8.0_121
[TEST OK] [1==1] Java version 1.8 does not satisfy requirement 9
[TEST OK] [1==1] Java version 1.8 does not satisfy requirement 9+
[TEST OK] [1==1] Java version 1.8 does not satisfy requirement 9*
[TEST OK] [1==1] Java version 1.8 does not satisfy requirement 9.1.2

Tests with Java 9:
[TEST OK] [1==1] Java version 9 does not satisfy requirement 1.6
[TEST OK] [0==0] Java version 9 satisfies requirement 1.6+
[TEST OK] [1==1] Java version 9 does not satisfy requirement 1.6*
[TEST OK] [2==2] Invalid Java version requirement 1.6.0_45
[TEST OK] [1==1] Java version 9 does not satisfy requirement 1.7
[TEST OK] [0==0] Java version 9 satisfies requirement 1.7+
[TEST OK] [1==1] Java version 9 does not satisfy requirement 1.7*
[TEST OK] [2==2] Invalid Java version requirement 1.7.0_71
[TEST OK] [1==1] Java version 9 does not satisfy requirement 1.8
[TEST OK] [0==0] Java version 9 satisfies requirement 1.8+
[TEST OK] [1==1] Java version 9 does not satisfy requirement 1.8*
[TEST OK] [2==2] Invalid Java version requirement 1.8.0_121
[TEST OK] [0==0] Java version 9 satisfies requirement 9
[TEST OK] [0==0] Java version 9 satisfies requirement 9+
[TEST OK] [0==0] Java version 9 satisfies requirement 9*
[TEST OK] [1==1] Java version 9 does not satisfy requirement 9.1.2

Tests with Java 10:
[TEST OK] [1==1] Java version 10 does not satisfy requirement 1.6
[TEST OK] [0==0] Java version 10 satisfies requirement 1.6+
[TEST OK] [1==1] Java version 10 does not satisfy requirement 1.6*
[TEST OK] [2==2] Invalid Java version requirement 1.6.0_45
[TEST OK] [1==1] Java version 10 does not satisfy requirement 1.7
[TEST OK] [0==0] Java version 10 satisfies requirement 1.7+
[TEST OK] [1==1] Java version 10 does not satisfy requirement 1.7*
[TEST OK] [2==2] Invalid Java version requirement 1.7.0_71
[TEST OK] [1==1] Java version 10 does not satisfy requirement 1.8
[TEST OK] [0==0] Java version 10 satisfies requirement 1.8+
[TEST OK] [1==1] Java version 10 does not satisfy requirement 1.8*
[TEST OK] [2==2] Invalid Java version requirement 1.8.0_121
[TEST OK] [1==1] Java version 10 does not satisfy requirement 9
[TEST OK] [0==0] Java version 10 satisfies requirement 9+
[TEST OK] [1==1] Java version 10 does not satisfy requirement 9*
[TEST OK] [1==1] Java version 10 does not satisfy requirement 9.1.2
[TEST OK] [0==0] Java version 10 satisfies requirement 10
[TEST OK] [0==0] Java version 10 satisfies requirement 10+
[TEST OK] [0==0] Java version 10 satisfies requirement 10*
[TEST OK] [1==1] Java version 10 does not satisfy requirement 10.0.13

@tofi86
Copy link
Owner

tofi86 commented Jun 11, 2017

Please note that I'm on vacation until June 26

@tofi86
Copy link
Owner

tofi86 commented Jul 1, 2017

Hi @dtuma, have you been able to test the latest version from the develop branch with the changes for Java 9?

@dtuma
Copy link
Author

dtuma commented Jul 3, 2017

I apologize for the slow reply. (I was out of the office as well, and thus away from the Mac where I could perform a test.)

The version on the develop branch is working well with Java 9. Thank you so much for your responsiveness on this item!

@tofi86
Copy link
Owner

tofi86 commented Jul 4, 2017

Great, thanks for testing this! Will release a new version soon...

@tofi86
Copy link
Owner

tofi86 commented Jul 28, 2017

Released version 2.1.0 just now!

@tofi86 tofi86 closed this as completed Jul 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants