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


#1

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


(David Pilato) #2

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


#3


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


(David Pilato) #4

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


#5

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


(David Pilato) #6

Probably you did not set correctly your JAVA_HOME.


#7

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:


(David Pilato) #8

JAVA_HOM ?


#9

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


(system) #10

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