Skip to content

Commit 02b28dd

Browse files
committed
Fix using bundled JDK detection on macOS (#64236)
This commit fixes an issue with the detection on macOS for whether or not the bundled JDK is being used. The logic between macOS and non-macOS is different because the JDK has a different directory structure on macOS versus non-macOS. However, due to notarization issues, we changed the top-level directory from jdk to jdk.app, yet never updated this detection logic to account for that. Ideally, we would have a packaging test that asserts that we have the behavior here correct, and it maintains over time. Alas, we do not currently have packaging tests on macOS.
1 parent 4382b8e commit 02b28dd

File tree

1 file changed

+1
-1
lines changed
  • server/src/main/java/org/elasticsearch/monitor/jvm

1 file changed

+1
-1
lines changed

server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ private static boolean usingBundledJdk() {
178178
final String javaHome = System.getProperty("java.home");
179179
final String userDir = System.getProperty("user.dir");
180180
if (Constants.MAC_OS_X) {
181-
return PathUtils.get(javaHome).equals(PathUtils.get(userDir).resolve("jdk/Contents/Home").toAbsolutePath());
181+
return PathUtils.get(javaHome).equals(PathUtils.get(userDir).resolve("jdk.app/Contents/Home").toAbsolutePath());
182182
} else {
183183
return PathUtils.get(javaHome).equals(PathUtils.get(userDir).resolve("jdk").toAbsolutePath());
184184
}

0 commit comments

Comments
 (0)