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
Open
@rambaut

Description

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?

Activity

tofi86

tofi86 commented on Aug 7, 2018

@tofi86
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Preferring JRE over JDK · Issue #68 · tofi86/universalJavaApplicationStub