Skip to content

Commit 52dd7cf

Browse files
committed
Return the base dir of "good" installations
Previously we were returning the "release" dir path, which doesn't work e.g. when set as the jvm-dir.
1 parent 93b240f commit 52dd7cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/scijava/launcher/Java.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public static Path goodInstallation() throws IOException {
178178
String recommended = recommendedVersion();
179179
for (Path javaHome : installations()) {
180180
String v = readVersion(javaHome);
181-
if (v != null && Versions.compare(v, recommended) >= 0) return javaHome;
181+
if (v != null && Versions.compare(v, recommended) >= 0) return javaHome.getParent();
182182
}
183183
return null;
184184
}

0 commit comments

Comments
 (0)