imagej / imagej-launcher

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

Launcher on windows with java 11+ doesn't work #93

Open BishopWolf opened 11 months ago

BishopWolf commented 11 months ago

The FIJI launcher for windows doesn't work with java 11. This is related to wrong file separator

PS ~\Fiji.app> .\ImageJ-win64.exe --java-home="C:\\JAVA\\java-11-openjdk" --debug
PS ~\Fiji.app> JRE not found in 'C:\Users\ALEX~1.VER\DOCUME~1\Fiji.app/jre'                   // Note this line with mangled path
JAVA_HOME appears to be a JRE: 'C:\\JAVA\\java-11-openjdk'
Available RAM: 8075MB, using 3/4 of that: 6057MB
Splashscreen library not found: 'C:\\JAVA\\java-11-openjdk/bin/splashscreen.dll'
javaw -Dpython.cachedir.skip=true -Dplugins.dir=C:\\Users\\ALEX~1.VER\\DOCUME~1\\Fiji.app -Xmx6057m -Xincgc -XX:PermSize=128m -Djava.class.path=C:\\Users\\ALEX~1.VER\\DOCUME~1\\Fiji.app/jars/imagej-launcher-6.0.2.jar -Dimagej.dir=C:\\Users\\ALEX~1.VER\\DOCUME~1\\Fiji.app -Dij.dir=C:\\Users\\ALEX~1.VER\\DOCUME~1\\Fiji.app -Dfiji.dir=C:\\Users\\ALEX~1.VER\\DOCUME~1\\Fiji.app -Dfiji.defaultLibPath=bin/server/jvm.dll -Dfiji.executable=C:\\Users\\alex.vergara\\Documents\\Fiji.app\\ImageJ-win64.exe -Dij.executable=C:\\Users\\alex.vergara\\Documents\\Fiji.app\\ImageJ-win64.exe -Djava.library.path=C:\\Users\\ALEX~1.VER\\DOCUME~1\\Fiji.app/lib/win64;C:\\Users\\ALEX~1.VER\\DOCUME~1\\Fiji.app/mm/win64 -Dscijava.context.strict=false -Dij.debug=true -Dscijava.log.level=debug net.imagej.launcher.ClassLauncher -ijjarpath jars -ijjarpath plugins net.imagej.Main
Using JAVA_HOME C:\\JAVA\\java-11-openjdk
Opening Java library C:\\JAVA\\java-11-openjdk/bin/server/jvm.dll
Warning: falling back to System JVM

Please notice the paths are mangled and a lot of hard coded forward slashes mess up with the correct paths. You can use File.separator instead, this will work everywhere.

mkitti commented 9 months ago

Could you specify from where you downloaded Java 11? Oracle? Azul Zulu? Regarding File.separator, part of the issue is that launcher is largely coded in C, not Java.

ctrueden commented 9 months ago

I am working on a new launcher to replace the current ImageJ Launcher. Source code is here. But it's Linux only right now. I will start working on Windows support soon, though.