From b1c50254986cf435d5bec4cba4e16717b56875eb Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 31 Oct 2019 15:11:44 -0400 Subject: [PATCH] Package the JDK into jdk.app on macOS (#48765) This commit packages the bundled JDK into jdk.app on macOS to assist with notarization there. --- distribution/archives/build.gradle | 10 ++++++++-- distribution/src/bin/elasticsearch-env | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/distribution/archives/build.gradle b/distribution/archives/build.gradle index d6d8567080a..c3ca84a53f2 100644 --- a/distribution/archives/build.gradle +++ b/distribution/archives/build.gradle @@ -61,8 +61,14 @@ CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String pla with binFiles(distributionType, oss, jdk) } if (jdk) { - into('jdk') { - with jdkFiles(project, platform) + if ("darwin".equals(platform)) { + into('jdk.app') { + with jdkFiles(project, platform) + } + } else { + into('jdk') { + with jdkFiles(project, platform) + } } } into('') { diff --git a/distribution/src/bin/elasticsearch-env b/distribution/src/bin/elasticsearch-env index e13eb824e77..867e19b3edd 100644 --- a/distribution/src/bin/elasticsearch-env +++ b/distribution/src/bin/elasticsearch-env @@ -41,8 +41,8 @@ if [ ! -z "$JAVA_HOME" ]; then JAVA_TYPE="JAVA_HOME" else if [ "$(uname -s)" = "Darwin" ]; then - # OSX has a different structure - JAVA="$ES_HOME/jdk/Contents/Home/bin/java" + # macOS has a different structure + JAVA="$ES_HOME/jdk.app/Contents/Home/bin/java" else JAVA="$ES_HOME/jdk/bin/java" fi