diff --git a/core/src/main/java/pl/allegro/tech/embeddedelasticsearch/ElasticServer.java b/core/src/main/java/pl/allegro/tech/embeddedelasticsearch/ElasticServer.java index f1cb2ea..62639d6 100644 --- a/core/src/main/java/pl/allegro/tech/embeddedelasticsearch/ElasticServer.java +++ b/core/src/main/java/pl/allegro/tech/embeddedelasticsearch/ElasticServer.java @@ -77,6 +77,12 @@ private void startElasticProcess() { synchronized (this) { ProcessBuilder builder = new ProcessBuilder(); builder.environment().put("ES_JAVA_OPTS", esJavaOpts); + if (builder.environment().containsKey("ES_HOME")) { + builder.environment().remove("ES_HOME"); + } + if (builder.environment().containsKey("ES_PATH_CONF")) { + builder.environment().remove("ES_PATH_CONF"); + } javaHome.ifNeedBeSet(javaHomeValue -> builder.environment().put("JAVA_HOME", javaHomeValue)); builder.redirectErrorStream(true); builder.command(elasticExecutable());