Skip to content

Commit

Permalink
Handle missing default VMInstall when querying JVM system-packages
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesWell committed Aug 24, 2023
1 parent ac4df5b commit b91c1ac
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -532,14 +532,18 @@ public static String querySystemPackages(IExecutionEnvironment environment, Prop
if (javaPackages == null) {
String profileSystemPackages = preJava9ProfileProperties.getProperty(Constants.FRAMEWORK_SYSTEMPACKAGES, ""); //$NON-NLS-1$
if (profileSystemPackages.isBlank()) {
return null;
return List.of();
}
javaPackages = COMMA.splitAsStream(profileSystemPackages).filter(p -> p.startsWith("java.")).toList(); //$NON-NLS-1$
}
IVMInstall targetVM = JavaRuntime.getDefaultVMInstall(); // Set by the Target-Definition if specified there
if (targetVM == null) {
LOGGER.warn("No default JRE installation selected available"); //$NON-NLS-1$
return List.of();
}
Collection<String> targetVMSystemPackages = querySystemPackages(targetVM, null);
if (targetVMSystemPackages == null) {
return null;
return List.of();
}
Stream<String> targetVMNonJavaPackages = targetVMSystemPackages.stream().filter(p -> !p.startsWith("java.")); //$NON-NLS-1$

Expand Down

0 comments on commit b91c1ac

Please sign in to comment.