I ran the command bin/elasticsearch command and got the error
Error: Could not find or load main class org.elasticsearch.bootstrap.Elasticsearch
As per previous threads I ensured that my java Home variable was set correctly and even put a direct link to jdk 1.8.0_151 in my path variable. Nevertheless I continue to have this issue. I would appreciate any advice on how to fix it.
Hi, I am sorry that you are having trouble. Issues like this are usually environment issues (e.g., permissions issues). Let us see if we can work through this one together.
Let us start by running from the root of the Elasticsearch installation directory:
$ bash -x ./bin/elasticsearch
By the way, what version is this? How did you install Elasticsearch (from an archive like tar.gz, or using a package manager like yum)? What user are you running Elasticsearch as? Could you also do (again from the root of the Elasticsearch installation directory):
I downloaded the 2.4.1 version of elastic search from https://www.elastic.co/downloads/past-releases/elasticsearch-2-4-1. I downloaded a zipped file and unzipped it simply using command line. I am running elastic search from the root user of my computer but I run the command through bash. I am on a windows 10 64-bit system otherwise. And upon running the recommended command I get the following output.
total 24892
drwxr-xr-x 1 kgoel 197609 0 Mar 27 16:01 ./
drwxr-xr-x 1 kgoel 197609 0 Mar 27 16:02 ../
-rw-r--r-- 1 kgoel 197609 448794 Mar 27 16:01 apache-log4j-extras-1.2.17.jar
-rw-r--r-- 1 kgoel 197609 52988 Mar 27 16:01 commons-cli-1.3.1.jar
-rw-r--r-- 1 kgoel 197609 110694 Mar 27 16:01 compiler-0.8.13.jar
-rw-r--r-- 1 kgoel 197609 79732 Mar 27 16:01 compress-lzf-1.0.2.jar
-rw-r--r-- 1 kgoel 197609 9484320 Mar 27 16:01 elasticsearch-2.4.1.jar
-rw-r--r-- 1 kgoel 197609 2256213 Mar 27 16:01 guava-18.0.jar
-rw-r--r-- 1 kgoel 197609 109723 Mar 27 16:01 HdrHistogram-2.1.6.jar
-rw-r--r-- 1 kgoel 197609 1140290 Mar 27 16:01 hppc-0.7.1.jar
-rw-r--r-- 1 kgoel 197609 280014 Mar 27 16:01 jackson-core-2.8.1.jar
-rw-r--r-- 1 kgoel 197609 50196 Mar 27 16:01 jackson-dataformat-cbor-2.8.1.jar
-rw-r--r-- 1 kgoel 197609 72874 Mar 27 16:01 jackson-dataformat-smile-2.8.1.jar
-rw-r--r-- 1 kgoel 197609 40540 Mar 27 16:01 jackson-dataformat-yaml-2.8.1.jar
-rw-r--r-- 1 kgoel 197609 914597 Mar 27 16:01 jna-4.1.0.jar
-rw-r--r-- 1 kgoel 197609 38460 Mar 27 16:01 joda-convert-1.2.jar
-rw-r--r-- 1 kgoel 197609 629506 Mar 27 16:01 joda-time-2.9.4.jar
-rw-r--r-- 1 kgoel 197609 62226 Mar 27 16:01 jsr166e-1.1.0.jar
-rw-r--r-- 1 kgoel 197609 794991 Mar 27 16:01 jts-1.13.jar
-rw-r--r-- 1 kgoel 197609 489884 Mar 27 16:01 log4j-1.2.17.jar
-rw-r--r-- 1 kgoel 197609 1576592 Mar 27 16:01 lucene-analyzers-common-5.5.2.jar
-rw-r--r-- 1 kgoel 197609 430602 Mar 27 16:01 lucene-backward-codecs-5.5.2.jar
-rw-r--r-- 1 kgoel 197609 2368341 Mar 27 16:01 lucene-core-5.5.2.jar
-rw-r--r-- 1 kgoel 197609 107160 Mar 27 16:01 lucene-grouping-5.5.2.jar
-rw-r--r-- 1 kgoel 197609 144597 Mar 27 16:01 lucene-highlighter-5.5.2.jar
-rw-r--r-- 1 kgoel 197609 136173 Mar 27 16:01 lucene-join-5.5.2.jar
-rw-r--r-- 1 kgoel 197609 33803 Mar 27 16:01 lucene-memory-5.5.2.jar
-rw-r--r-- 1 kgoel 197609 172291 Mar 27 16:01 lucene-misc-5.5.2.jar
-rw-r--r-- 1 kgoel 197609 251401 Mar 27 16:01 lucene-queries-5.5.2.jar
-rw-r--r-- 1 kgoel 197609 402296 Mar 27 16:01 lucene-queryparser-5.5.2.jar
-rw-r--r-- 1 kgoel 197609 232257 Mar 27 16:01 lucene-sandbox-5.5.2.jar
-rw-r--r-- 1 kgoel 197609 197316 Mar 27 16:01 lucene-spatial3d-5.5.2.jar
-rw-r--r-- 1 kgoel 197609 261161 Mar 27 16:01 lucene-spatial-5.5.2.jar
-rw-r--r-- 1 kgoel 197609 246202 Mar 27 16:01 lucene-suggest-5.5.2.jar
-rw-r--r-- 1 kgoel 197609 1292696 Mar 27 16:01 netty-3.10.6.Final.jar
-rw-r--r-- 1 kgoel 197609 7024 Mar 27 16:01 securesm-1.0.jar
-rw-r--r-- 1 kgoel 197609 269295 Mar 27 16:01 snakeyaml-1.15.jar
-rw-r--r-- 1 kgoel 197609 148571 Mar 27 16:01 spatial4j-0.5.jar
-rw-r--r-- 1 kgoel 197609 49754 Mar 27 16:01 t-digest-3.0.jar
for include in /usr/share/elasticsearch/elasticsearch.in.sh /usr/local/share/elasticsearch/elasticsearch.in.sh /opt/elasticsearch/elasticsearch.in.sh ~/.elasticsearch.in.sh "$ES_HOME/bin/elasticsearch.in.sh" "dirname "$0""/elasticsearch.in.sh
for include in /usr/share/elasticsearch/elasticsearch.in.sh /usr/local/share/elasticsearch/elasticsearch.in.sh /opt/elasticsearch/elasticsearch.in.sh ~/.elasticsearch.in.sh "$ES_HOME/bin/elasticsearch.in.sh" "dirname "$0""/elasticsearch.in.sh
for include in /usr/share/elasticsearch/elasticsearch.in.sh /usr/local/share/elasticsearch/elasticsearch.in.sh /opt/elasticsearch/elasticsearch.in.sh ~/.elasticsearch.in.sh "$ES_HOME/bin/elasticsearch.in.sh" "dirname "$0""/elasticsearch.in.sh
'[' -r /opt/elasticsearch/elasticsearch.in.sh ']'
for include in /usr/share/elasticsearch/elasticsearch.in.sh /usr/local/share/elasticsearch/elasticsearch.in.sh /opt/elasticsearch/elasticsearch.in.sh ~/.elasticsearch.in.sh "$ES_HOME/bin/elasticsearch.in.sh" "dirname "$0""/elasticsearch.in.sh
'[' -r /c/Users/kgoel/.elasticsearch.in.sh ']'
for include in /usr/share/elasticsearch/elasticsearch.in.sh /usr/local/share/elasticsearch/elasticsearch.in.sh /opt/elasticsearch/elasticsearch.in.sh ~/.elasticsearch.in.sh "$ES_HOME/bin/elasticsearch.in.sh" "dirname "$0""/elasticsearch.in.sh
Ah, it looks like you're running on bash on Windows (or some variant, like Git bash on Windows, or Cygwin). I am sorry to say that I do not think that will work. Would you try the batch file from the command prompt (.\bin\elasticsearch.bat)?
That one is puzzling. Let us see if we can figure it out. I suspect it might be some quoting of JAVA_HOME, so let us start there. What is the output of echo %JAVA_HOME%?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.