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();
|
||||
if (platformOptional.isPresent()) {
|
||||
String platform = platformOptional.get();
|
||||
for (Path component : Files.newDirectoryStream(getJavaStoragePath())) {
|
||||
Path javaHome = component.resolve(platform).resolve(component.getFileName());
|
||||
try {
|
||||
addJava(javaHome);
|
||||
} catch (IOException e) {
|
||||
LOG.log(Level.WARNING, "Failed to determine Java at " + javaHome, e);
|
||||
Path javaStoragePath = getJavaStoragePath();
|
||||
if (Files.isDirectory(javaStoragePath)) {
|
||||
for (Path component : Files.newDirectoryStream(javaStoragePath)) {
|
||||
Path javaHome = component.resolve(platform).resolve(component.getFileName());
|
||||
try {
|
||||
addJava(javaHome);
|
||||
} catch (IOException e) {
|
||||
LOG.log(Level.WARNING, "Failed to determine Java at " + javaHome, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user