[5.6.8] Trigerred "could not find or load main class" with -cp command

(Alexandre Roux) #1

Hello there,

First time I'm posting here, I've tried to add as much details as I can.

My purpose, is to install elasticsearch-5.6.8 with custom values for :


Here I've an up a running elasticsearch-2.4.3 and I'm installing a new 5.6.8 to replace using the zip archive from elasticsearch website.

I'm using a symlink at /opt/application/elasticsearch/current/ to switch between 2.4.3 to 5.6.8 installation.

I've review the elasticsearch-5.6.8 release notes and apply the according changes to elasticsearch.yml, sysconfig/elasticsearch, and jvm.options.

I'm using a redhat-6.x so I do not have to change elasticsearch.service file as I dot have systemd but I've to use a correct version of /etc/init.d/elasticsearch

My problems is that the java command -cp /opt/application/elasticsearch/current/lib/* for the 5.6.8 does not work properly as :

/bin/java -Xms2048m -Xmx2048m -XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly
-XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true
-Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true
-Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true
-Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false
-Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -XX:+HeapDumpOnOutOfMemoryError
-cp /opt/application/elasticsearch/current/lib/* org.elasticsearch.bootstrap.Elasticsearch 
-p /var/run/elasticsearch/elasticsearch.pid 
-d -Edefault.path.logs=/opt/application/elasticsearch/logs -Edefault.path.data=/var/opt/data/flat/elasticsearch 
Error: Could not find or load main class .opt.application.elasticsearch.current.lib.HdrHistogram-2.1.9.jar

Here if I change manualy the command to include HrdHistogram-2.1.9.jar as -cp /opt/application/elasticsearch/current/lib/HrdHistogram-2.1.9.jar I'm going to the next step of the installation but getting a similar issue :

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

This java command is trigerred by the bash script of elasticsearch from his bin directory, and I've read that -cp can take only one argument, but in my case it does not understand correctly the *

Thanks in advance for your feedback.

(system) #2

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