# ES 7.2.0 upgrade resulted in "Don't modify the classpath with ES\_CLASSPATH" error

**URL:** <https://discuss.elastic.co/t/es-7-2-0-upgrade-resulted-in-dont-modify-the-classpath-with-es-classpath-error/189431>\
**Category:** Elasticsearch\
**Created:** [July 8, 2019, 9:30pm UTC](https://discuss.elastic.co/t/es-7-2-0-upgrade-resulted-in-dont-modify-the-classpath-with-es-classpath-error/189431 "2019-07-08T21:30:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![KiloDunse](https://avatars.discourse-cdn.com/v4/letter/k/e9bcb4/32.png) [@KiloDunse](https://discuss.elastic.co/u/KiloDunse)\
**Post date:** [July 8, 2019, 9:30pm UTC](https://discuss.elastic.co/t/es-7-2-0-upgrade-resulted-in-dont-modify-the-classpath-with-es-classpath-error/189431/1 "2019-07-08T21:30:19Z")

</div>

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/\*

---

<div class="post-metadata">

**Author:** ![KiloDunse](https://avatars.discourse-cdn.com/v4/letter/k/e9bcb4/32.png) [@KiloDunse](https://discuss.elastic.co/u/KiloDunse)\
**Post date:** [July 8, 2019, 10:40pm UTC](https://discuss.elastic.co/t/es-7-2-0-upgrade-resulted-in-dont-modify-the-classpath-with-es-classpath-error/189431/2 "2019-07-08T22:40:22Z")

</div>

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=

---

<div class="post-metadata">

**Author:** ![Andre\_Letterer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_letterer/32/42248_2.png) [@Andre\_Letterer](https://discuss.elastic.co/u/Andre_Letterer)\
**Post date:** [July 8, 2019, 10:40pm UTC](https://discuss.elastic.co/t/es-7-2-0-upgrade-resulted-in-dont-modify-the-classpath-with-es-classpath-error/189431/3 "2019-07-08T22:40:49Z")

</div>

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:

```auto
cd C:\Program Files\Elastic\Elasticsearch\7.2.0

```

```auto
bin\elasticsearch.exe

```

I have seen you have JAVA\_HOME set to a JDK10.  
So maybe try to disable JAVA\_HOME by command

```auto
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

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

```

---

<div class="post-metadata">

**Author:** ![Andre\_Letterer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_letterer/32/42248_2.png) [@Andre\_Letterer](https://discuss.elastic.co/u/Andre_Letterer)\
**Post date:** [July 8, 2019, 10:43pm UTC](https://discuss.elastic.co/t/es-7-2-0-upgrade-resulted-in-dont-modify-the-classpath-with-es-classpath-error/189431/4 "2019-07-08T22:43:16Z")

</div>

Ah, ok, seems you solved it already.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 5, 2019, 10:58pm UTC](https://discuss.elastic.co/t/es-7-2-0-upgrade-resulted-in-dont-modify-the-classpath-with-es-classpath-error/189431/5 "2019-08-05T22:58:30Z")

</div>

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