aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-main
diff options
context:
space:
mode:
authorJacek <jacek.poreda@sonarsource.com>2021-06-17 13:53:05 +0200
committersonartech <sonartech@sonarsource.com>2021-06-17 20:03:08 +0000
commit4d8578acc6a8618558e92b58ad19287f94200c2f (patch)
treeeaa53b05ad098f7e6bd03bcdda1bd1eeb6383a15 /server/sonar-main
parent80f1f7218e195751a765507f018a13b98f953d50 (diff)
downloadsonarqube-4d8578acc6a8618558e92b58ad19287f94200c2f.tar.gz
sonarqube-4d8578acc6a8618558e92b58ad19287f94200c2f.zip
SONAR-14960 Fix Elasticsearch deprecation warning for JAVA_HOME
Diffstat (limited to 'server/sonar-main')
-rw-r--r--server/sonar-main/src/main/java/org/sonar/application/command/CommandFactoryImpl.java4
-rw-r--r--server/sonar-main/src/test/java/org/sonar/application/command/CommandFactoryImplTest.java4
2 files changed, 4 insertions, 4 deletions
diff --git a/server/sonar-main/src/main/java/org/sonar/application/command/CommandFactoryImpl.java b/server/sonar-main/src/main/java/org/sonar/application/command/CommandFactoryImpl.java
index b51d2a69e6f..5b89acf18ce 100644
--- a/server/sonar-main/src/main/java/org/sonar/application/command/CommandFactoryImpl.java
+++ b/server/sonar-main/src/main/java/org/sonar/application/command/CommandFactoryImpl.java
@@ -109,7 +109,7 @@ public class CommandFactoryImpl implements CommandFactory {
.setEsInstallation(esInstallation)
.setEnvVariable("ES_PATH_CONF", esInstallation.getConfDirectory().getAbsolutePath())
.setEnvVariable("ES_JVM_OPTIONS", esInstallation.getJvmOptions().getAbsolutePath())
- .setEnvVariable("JAVA_HOME", System.getProperties().getProperty("java.home"))
+ .setEnvVariable("ES_JAVA_HOME", System.getProperties().getProperty("java.home"))
.suppressEnvVariable(ENV_VAR_JAVA_TOOL_OPTIONS)
.suppressEnvVariable(ENV_VAR_ES_JAVA_OPTS);
}
@@ -124,7 +124,7 @@ public class CommandFactoryImpl implements CommandFactory {
.add("-Des.path.home=" + esInstallation.getHomeDirectory().getAbsolutePath())
.add("-Des.path.conf=" + esInstallation.getConfDirectory().getAbsolutePath()))
.setEnvVariable("ES_JVM_OPTIONS", esInstallation.getJvmOptions().getAbsolutePath())
- .setEnvVariable("JAVA_HOME", System.getProperties().getProperty("java.home"))
+ .setEnvVariable("ES_JAVA_HOME", System.getProperties().getProperty("java.home"))
.setClassName("org.elasticsearch.bootstrap.Elasticsearch")
.addClasspath("lib/*")
.suppressEnvVariable(ENV_VAR_JAVA_TOOL_OPTIONS)
diff --git a/server/sonar-main/src/test/java/org/sonar/application/command/CommandFactoryImplTest.java b/server/sonar-main/src/test/java/org/sonar/application/command/CommandFactoryImplTest.java
index ddcf1cad501..ff12bbb68c6 100644
--- a/server/sonar-main/src/test/java/org/sonar/application/command/CommandFactoryImplTest.java
+++ b/server/sonar-main/src/test/java/org/sonar/application/command/CommandFactoryImplTest.java
@@ -145,7 +145,7 @@ public class CommandFactoryImplTest {
assertThat(esCommand.getEnvVariables())
.contains(entry("ES_PATH_CONF", esConfDir.getAbsolutePath()))
.contains(entry("ES_JVM_OPTIONS", new File(esConfDir, "jvm.options").getAbsolutePath()))
- .containsKey("JAVA_HOME");
+ .containsKey("ES_JAVA_HOME");
assertThat(esCommand.getSuppressedEnvVariables()).containsOnly("JAVA_TOOL_OPTIONS", "ES_JAVA_OPTS");
assertThat(esConfig.getEsJvmOptions().getAll())
@@ -181,7 +181,7 @@ public class CommandFactoryImplTest {
assertThat(esCommand.getArguments()).isEmpty();
assertThat(esCommand.getEnvVariables())
.contains(entry("ES_JVM_OPTIONS", new File(esConfDir, "jvm.options").getAbsolutePath()))
- .containsKey("JAVA_HOME");
+ .containsKey("ES_JAVA_HOME");
assertThat(esCommand.getSuppressedEnvVariables()).containsOnly("JAVA_TOOL_OPTIONS", "ES_JAVA_OPTS");
assertThat(esConfig.getEsJvmOptions().getAll())