fix: Do not throw exception when path to cached jvm installations does not exist.
This commit is contained in:
@@ -43,12 +43,15 @@ public final class JavaRepository {
|
|||||||
Optional<String> platformOptional = getCurrentJavaPlatform();
|
Optional<String> platformOptional = getCurrentJavaPlatform();
|
||||||
if (platformOptional.isPresent()) {
|
if (platformOptional.isPresent()) {
|
||||||
String platform = platformOptional.get();
|
String platform = platformOptional.get();
|
||||||
for (Path component : Files.newDirectoryStream(getJavaStoragePath())) {
|
Path javaStoragePath = getJavaStoragePath();
|
||||||
Path javaHome = component.resolve(platform).resolve(component.getFileName());
|
if (Files.isDirectory(javaStoragePath)) {
|
||||||
try {
|
for (Path component : Files.newDirectoryStream(javaStoragePath)) {
|
||||||
addJava(javaHome);
|
Path javaHome = component.resolve(platform).resolve(component.getFileName());
|
||||||
} catch (IOException e) {
|
try {
|
||||||
LOG.log(Level.WARNING, "Failed to determine Java at " + javaHome, e);
|
addJava(javaHome);
|
||||||
|
} catch (IOException e) {
|
||||||
|
LOG.log(Level.WARNING, "Failed to determine Java at " + javaHome, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user