Installing Elasticsearch 5.0.2 on Windows 8 - \ config \ jvm.options "was unexpected at this time"

I am new to Qaru (although I have been a lurker for a long time). I am trying to install elasticsearch on my laptop. This is windows 8, I just upgraded Java to Java 8, and I set a new path using JAVA_HOME.

However, when I try to run the elasticsearch.bat file on the command line, I get this error:

\ elasticsearch-5.0.2 \ bin \ .. \ config \ jvm.options was unexpected at the moment

Any help would be greatly appreciated on this subject.

+8
java elasticsearch
source share
2 answers

I also tried setting up ElasticSearch on my Windows 2016 R2 data center (64-bit). Let me share some of my impressions on how to solve this problem.


Setting JAVA_HOME

Make sure you have JDK / JRE installed. You can download here .

Set the JAVA_HOME environment variable. To do this, open the Start menu and enter " path ".

environment_variable

Then click Environment Variables . If you do not already have the JAVA_HOME variable, click Create .

java_home

The JAVA_HOME variable should only lead to the JDK / JRE directory, not including / bin.

C:\Progra~1\Java\jdk1.8.0_112 

Progra ~ 1 corresponds to Program Files . If you are using Program Files (x86) , change Progra ~ 1 to Progra ~ 2

Reboot the computer. After restarting your computer, open CMD and enter echo% JAVA_HOME% . The exit should be

 C:\Progra~1\Java\jdk1.8.0_112 

If you get the following result, your JAVA_HOME is configured correctly.


Running ElasticSearch

The first time I tried running ElasticSearch, I get the following output.

enter image description here

The odd directory that I pointed out here gave me a hint that the batch file might be reading from the wrong directory. So what I did was a bit of work with the batch file. Open elasticsearch.bat using any text editor.

Scroll all the way to the end, somewhere above the last lines you will see something similar to the following.

Wrong Way

Delete the highlighted line, save the file and try running the batch file again using the command line.

This works in my case.

run

After that, open your browser and go to localhost: 9200 .

localhost

I think that it's?

+6
source share

Your problem is most likely caused by parentheses on the way to where you unpacked and run Elasticsearch. A related issue is in the Elasticsearch repository # 24712 , which will be fixed using Elasticsearch 5.4.1.

Keep in mind that when applying Nicholas Lee's “fix”, you tell Elasticsearch to effectively ignore all settings in config/jvm.options . Although this may help you start Elasticsearch in this particular case, it will only start with the default JVM options, which can lead to unexpected behavior on the road.

+3
source share

All Articles