diff --git a/launcher/src/main/java/com/skcraft/launcher/launch/runtime/JavaRuntimeFinder.java b/launcher/src/main/java/com/skcraft/launcher/launch/runtime/JavaRuntimeFinder.java index 456a07577..01ecf2efe 100644 --- a/launcher/src/main/java/com/skcraft/launcher/launch/runtime/JavaRuntimeFinder.java +++ b/launcher/src/main/java/com/skcraft/launcher/launch/runtime/JavaRuntimeFinder.java @@ -43,6 +43,7 @@ public static List getAvailableRuntimes() { // Add system Javas runtimeFinder.getCandidateJavaLocations().stream() .map(JavaRuntimeFinder::getRuntimeFromPath) + .filter(Objects::nonNull) .forEach(entries::add); // Add extra runtimes @@ -95,6 +96,11 @@ public static JavaRuntime getRuntimeFromPath(File target) { binFolder = new File(target, "jre/bin"); } + if (!binFolder.isDirectory()) { + // No bin folder, this isn't a usable install + return null; + } + JavaReleaseFile release = JavaReleaseFile.parseFromRelease(releaseFile.getParentFile()); if (release == null) { // Make some assumptions...