Skip to content

Commit

Permalink
Disregard Java runtimes that don't have a bin folder
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgehog1029 committed Apr 23, 2022
1 parent 3c4c38e commit 8e1337d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public static List<JavaRuntime> getAvailableRuntimes() {
// Add system Javas
runtimeFinder.getCandidateJavaLocations().stream()
.map(JavaRuntimeFinder::getRuntimeFromPath)
.filter(Objects::nonNull)
.forEach(entries::add);

// Add extra runtimes
Expand Down Expand Up @@ -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...
Expand Down

0 comments on commit 8e1337d

Please sign in to comment.