fix: Do not throw exception when path to cached jvm installations does not exist.
This commit is contained in:
@@ -43,7 +43,9 @@ public final class JavaRepository {
|
||||
Optional<String> platformOptional = getCurrentJavaPlatform();
|
||||
if (platformOptional.isPresent()) {
|
||||
String platform = platformOptional.get();
|
||||
for (Path component : Files.newDirectoryStream(getJavaStoragePath())) {
|
||||
Path javaStoragePath = getJavaStoragePath();
|
||||
if (Files.isDirectory(javaStoragePath)) {
|
||||
for (Path component : Files.newDirectoryStream(javaStoragePath)) {
|
||||
Path javaHome = component.resolve(platform).resolve(component.getFileName());
|
||||
try {
|
||||
addJava(javaHome);
|
||||
@@ -53,6 +55,7 @@ public final class JavaRepository {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Optional<String> getCurrentJavaPlatform() {
|
||||
if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX) {
|
||||
|
||||
Reference in New Issue
Block a user