imagej / imagej-launcher

The ImageJ native launcher
https://imagej.net/learn/launcher
BSD 2-Clause "Simplified" License
21 stars 23 forks source link

Make sure embedded JRE takes precedence on OS X #32

Closed ctrueden closed 3 years ago

ctrueden commented 9 years ago

From @rasband:

Another problem with the launcher on OS X is that I have not found a way to get it to use an embedded JRE. I tried putting a Java 8 JRE in Image.app/jre but the launcher did not use it.

If you launch ImageJ with the --debug flag, you can see that it is detecting the JRE, but still ultimately does not use it:

$ cd /Applications/Science/ImageJ.app
$ cp -rp /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre .
$ Contents/MacOS/ImageJ-macosx --debug
Available RAM: 4919MB, using 3/4 of that: 3690MB
JRE found in '/Applications/Science/ImageJ.app/jre'
Re-executing with correct library lookup path (/Applications/Science/ImageJ.app/lib/macosx:/Applications/Science/ImageJ.app/mm/macosx)
Available RAM: 4919MB, using 3/4 of that: 3690MB
JRE found in '/Applications/Science/ImageJ.app/jre'
java -Djava.ext.dirs=/Applications/Science/ImageJ.app/java/macosx-java3d/Home/lib/ext/Library/Java/Extensions:/System/Library/Java/Extensions:/System/Library/Frameworks/JavaVM.framework/Home/lib/ext -Dpython.cachedir.skip=true -Dplugins.dir=/Applications/Science/ImageJ.app -Xmx3690m -Xincgc -XX:PermSize=128m -Djava.class.path=/Applications/Science/ImageJ.app/jars/imagej-launcher-3.1.6.jar -Dimagej.dir=/Applications/Science/ImageJ.app -Dij.dir=/Applications/Science/ImageJ.app -Dfiji.dir=/Applications/Science/ImageJ.app -Dfiji.defaultLibPath=lib/server/libjvm.dylib -Dfiji.executable=/Applications/Science/ImageJ.app/Contents/MacOS/ImageJ-macosx -Dij.executable=/Applications/Science/ImageJ.app/Contents/MacOS/ImageJ-macosx -Djava.library.path=/Applications/Science/ImageJ.app/lib/macosx:/Applications/Science/ImageJ.app/mm/macosx -Dij.debug=true -Dscijava.log.level=debug net.imagej.launcher.ClassLauncher -ijjarpath jars -ijjarpath plugins net.imagej.Main
JavaVMBundlerVersionsDirURL: /System/Library/Frameworks/JavaVM.framework/Versions
TargetJavaVM: /System/Library/Frameworks/JavaVM.framework/Versions/1.6
Setting JAVA_JVM_VERSION to 1.6
ctrueden commented 9 years ago

Note that this needs to be retested with the latest ImageJ launcher which upgrades the OS X Java version detection.

hinerm commented 3 years ago

I believe this was resolved in the 6.0.0 release