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();
|
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();
|
||||||
|
if (Files.isDirectory(javaStoragePath)) {
|
||||||
|
for (Path component : Files.newDirectoryStream(javaStoragePath)) {
|
||||||
Path javaHome = component.resolve(platform).resolve(component.getFileName());
|
Path javaHome = component.resolve(platform).resolve(component.getFileName());
|
||||||
try {
|
try {
|
||||||
addJava(javaHome);
|
addJava(javaHome);
|
||||||
@@ -53,6 +55,7 @@ public final class JavaRepository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static Optional<String> getCurrentJavaPlatform() {
|
public static Optional<String> getCurrentJavaPlatform() {
|
||||||
if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX) {
|
if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX) {
|
||||||
|
|||||||
Reference in New Issue
Block a user