After upgrading ElasticSearch to 7.6.1, it failed to start when I tried to run ElasticSearch as a windows service.
In the logs I found the following error message:
[2020-03-30 10:04:11] [info] [ 4516] Service 'elasticsearch-service-x64' installed
[2020-03-30 10:04:11] [info] [ 4516] Commons Daemon procrun finished
[2020-03-30 10:04:23] [info] [ 4336] Commons Daemon procrun (1.1.0.0 64-bit) started
[2020-03-30 10:04:23] [info] [ 4336] Running 'elasticsearch-service-x64' Service...
[2020-03-30 10:04:23] [info] [ 4992] Starting service...
[2020-03-30 10:04:23] [error] [ 2432] CreateJavaVM Failed
[2020-03-30 10:04:23] [error] [ 2432] The system cannot find the file specified.
[2020-03-30 10:04:23] [error] [ 4992] Failed to start Java
[2020-03-30 10:04:23] [error] [ 4992] ServiceStart returned 4
[2020-03-30 10:04:23] [info] [ 4336] Run service finished.
[2020-03-30 10:04:23] [info] [ 4336] Commons Daemon procrun finished
The problem is that ElasticSearch tries to pass on a ‘-server’ option which is no longer supported in the latest JAVA versions.
To fix I had to change the Java Options:
- Install the windows service through ‘elasticsearch-service install’
- Open the ElasticSearch service manager through ‘elasticsearch-service manager’
- Go to the Java tab and remove the ‘-server’ flag from the Java Options
- Start the service