Could not find or load main class org.elasticsearch.bootstrap.Elasticsearch

I run the command with a non-root user but get an error
[elsearch@vultr elasticsearch-rtf]$ ./bin/elasticsearch
Error: Could not find or load main class org.elasticsearch.bootstrap.Elasticsearch
the java -version and javac command works fine.
I use centos6 x64 and jdk1.8

What exact URL you used to download elasticsearch?
Any other messages?


I use this repository .It's a starterkit for chinese development

I don't know then. May be @medcl.net can help.

I changed the download URL to https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.1.zip
And this time I run elasticsearch
Error: Could not find or load main class org.elasticsearch.tools.JavaVersionChecker
Elasticsearch requires at least Java 8 but your Java version from /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java does not meet this requirement

but I have installed jdk1.8

Probably you did not set correctly your JAVA_HOME.

this time I download jdk1.8 from oracle and elasticsearch5.1.1 from elastic.co
I edit /etc/profile
export JAVA_HOM=/usr/java/jdk1.8.0_144
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

still the same error:joy:

JAVA_HOM ?

its a typo
never mind.I just run it on an ubuntu os.it works fine

1 Like

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