ES 7.2.0 upgrade resulted in "Don't modify the classpath with ES_CLASSPATH" error

Hi,

I upgraded Elasticsearch from 6.8.0 to 7.2.0.

After install the service won't start.

If I start it from .exe i get this error:

The following deprecated environment variables are set and preventing elasticsearch from starting
Don't modify the classpath with ES_CLASSPATH, Best is to add additional elements via the plugin mechanism, or if code must really be added to the main classpath, add jars to lib, unsupported

elasticsearch.exe --debug-env gets this:

C:\Program Files\Elastic\Elasticsearch\7.2.0\bin>elasticsearch.exe --debug-env

Elasticsearch

ES_HOME (in order of precedence)

  • HomeDirectoryProcessVariable =
  • HomeDirectoryUserVariable =
  • HomeDirectoryMachineVariable = C:\Program Files\Elastic\Elasticsearch\7.2.0\
  • From executable location = C:\Program Files\Elastic\Elasticsearch\7.2.0
    ES_PATH_CONF (in order of precedence)
  • ConfigDirectoryProcessVariable = C:\ProgramData\Elastic\Elasticsearch\config
  • ConfigDirectoryUserVariable =
  • ConfigDirectoryMachineVariable = C:\ProgramData\Elastic\Elasticsearch\config
  • Fallback to ES_HOME = C:\Program Files\Elastic\Elasticsearch\7.2.0\config

Java

Java paths

  • current = c:\jdk-10.0.2\bin\java.exe
    Java Candidates (in order of precedence)
  • JavaHomeProcessVariable = c:\jdk-10.0.2
  • JavaHomeUserVariable =
  • JavaHomeMachineVariable = c:\jdk-10.0.2
  • JdkRegistry64 = C:\Program Files\Java\jdk-12.0.1
  • JreRegistry64 =
  • JdkRegistry32 =
  • JreRegistry32 =
    Java checks
  • Using32BitJava = False
  • JAVA_HOME as machine and user variable = False

ES_CLASSPATH is:

C:\Windows\system32>echo %ES_CLASSPATH%
$ES_HOME/lib/elasticsearch-7.2.0.jar:$ES_HOME/lib/*

Fixed it by running these command:

reg delete "HKCU\Environment" /v ES_CLASSPATH /f
reg delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /F /V ES_CLASSPATH
SET ES_CLASSPATH=

Hi, good to have you onboard,

would you mind please to test if you can start up elasticsearch by hand from a command line using:

cd C:\Program Files\Elastic\Elasticsearch\7.2.0
bin\elasticsearch.exe

I have seen you have JAVA_HOME set to a JDK10.
So maybe try to disable JAVA_HOME by command

set JAVA_HOME=

And then start elasticsearch.

This is because Elasticsearch has a built in JDK11 already.

I as a second start had to fix the gclog path from "logs/gc.log" to "\ProgramData\Elastic\Elasticsearch\logs\gc.log".

Hope that helps.

In case service does not start still, you can set the variable in the service as well of elasticsearch by starting up regedit.exe and

go in path:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Elasticsearch
create this value:
Environment   REG_MULTI_SZ    JAVA_HOME=

Ah, ok, seems you solved it already.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.