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

Preferring JRE over JDK #68

Open
1 of 3 tasks
rambaut opened this issue Aug 7, 2018 · 1 comment
Open
1 of 3 tasks

Preferring JRE over JDK #68

rambaut opened this issue Aug 7, 2018 · 1 comment
Labels

Comments

@rambaut
Copy link

rambaut commented Aug 7, 2018

I'm submitting a…

  • bug report
  • feature request
  • other

Short description of the issue/suggestion:
The current behaviour seems to be to prefer a JRE installed in /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/ over a JDK installed in /Library/Java/JavaVirtualMachines/

Why is this the preferred order of preference?

@tofi86
Copy link
Owner

tofi86 commented Aug 7, 2018

I assume you are using the latest version of the stub?

There is no real precedence of JRE over JDK or vice-versa.

This is from the syslog from one of my apps:

[JavaSearch] ... found JVM: 9.0.1:/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin/java
[JavaSearch] ... found JVM: 9:/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin/java
[JavaSearch] ... found JVM: 1.8.0_144:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/java
[JavaSearch] ... found JVM: 1.7.0_79:/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java
[JavaSearch] ... found JVM: 10.0.2:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java

The script first adds all the JDK's found to an array of available JVM's (https://github.com/tofi86/universalJavaApplicationStub/blob/master/src/universalJavaApplicationStub#L534-L540).

Then, if available, the Apple or Oracle JRE's are added to the same array (https://github.com/tofi86/universalJavaApplicationStub/blob/master/src/universalJavaApplicationStub#L544-L552).

In case you specified any JVM min/max version we delete every non-matching JVM from the array.

In any case after that, the JVM array is beeing sorted by JVM version number (https://github.com/tofi86/universalJavaApplicationStub/blob/master/src/universalJavaApplicationStub#L650-L653) and the first executable JVM is then selected for execution (https://github.com/tofi86/universalJavaApplicationStub/blob/master/src/universalJavaApplicationStub#L656-L674).

This can either be a JRE or JDK version, no preference of one over the other.

Preferring JRE over JDK or vice-versa is currently a "missing feature" as stated in the readme (https://github.com/tofi86/universalJavaApplicationStub#missing-features).

Hope that helps.

@tofi86 tofi86 added the question label Aug 7, 2018
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