Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* bug fix - Quarkus: generated sources are not accessible. See [#1675](https://github.com/redhat-developer/vscode-java/issues/1675)
* bug fix - Error in every java file after updating to macOS Big Sur. See [#1700](https://github.com/redhat-developer/vscode-java/issues/1700).
* bug fix - Fix jdk detection: cover symlink folder on Linux. See [#1704](https://github.com/redhat-developer/vscode-java/pull/1704).
* bug fix - Fix jdk detection: cover common JDK installation places on Linux. See [#1706](https://github.com/redhat-developer/vscode-java/pull/1706).
* other - Improve tracing capability of m2e through m2e.logback.configuration.. See [JLS#1589](https://github.com/eclipse/eclipse.jdt.ls/pull/1589).
* other - Infer expressions if there is no selection range when extracting method. See [#1680](https://github.com/redhat-developer/vscode-java/pull/1680).

Expand Down
19 changes: 19 additions & 0 deletions src/findJavaRuntimes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const expandHomeDir = require("expand-home-dir");
const WinReg = require("winreg-utf8");
const isWindows: boolean = process.platform.indexOf("win") === 0;
const isMac: boolean = process.platform.indexOf("darwin") === 0;
const isLinux: boolean = process.platform.indexOf("linux") === 0;
const JAVAC_FILENAME = "javac" + (isWindows ? ".exe" : "");
const JAVA_FILENAME = "java" + (isWindows ? ".exe" : "");

Expand Down Expand Up @@ -236,6 +237,24 @@ async function fromCommonPlaces(): Promise<string[]> {
}
}

// common place for Linux
if (isLinux) {
const jvmStore = "/usr/lib/jvm";
let jvms: string[] = [];
try {
jvms = await fse.readdir(jvmStore);
} catch (error) {
// ignore
}
for (const jvm of jvms) {
const proposed = path.join(jvmStore, jvm);
const javaHome = await verifyJavaHome(proposed, JAVAC_FILENAME);
if (javaHome) {
ret.push(javaHome);
}
}
}

return ret;
}

Expand Down