Skip to content

Commit 3ef1817

Browse files
committed
Extend DetectVMInstallationsJob to consider JAVA.*_HOME env variables
This matches the behavior of the maven-toolchains-plugin
1 parent 9ba1b48 commit 3ef1817

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/DetectVMInstallationsJob.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ private Collection<File> computeCandidateVMs(StandardVMType standardType) {
169169
if (jdkHome != null) {
170170
directories.add(new File(jdkHome));
171171
}
172-
System.getenv().entrySet().forEach(entry -> {
173-
if (entry.getKey().startsWith("JAVA_HOME_")) { //$NON-NLS-1$
174-
directories.add(new File(entry.getValue()));
172+
System.getenv().forEach((key, value) -> {
173+
if (key.startsWith("JAVA_HOME_") || (key.startsWith("JAVA") && key.endsWith("_HOME"))) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
174+
directories.add(new File(value));
175175
}
176176
});
177177
// other common/standard lookup strategies can be added here

0 commit comments

Comments
 (0)