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

**URL:** <https://discuss.elastic.co/t/5-6-8-trigerred-could-not-find-or-load-main-class-with-cp-command/137544>\
**Category:** Elasticsearch\
**Created:** [June 27, 2018, 6:08am UTC](https://discuss.elastic.co/t/5-6-8-trigerred-could-not-find-or-load-main-class-with-cp-command/137544 "2018-06-27T06:08:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandre\_Roux](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@Alexandre\_Roux](https://discuss.elastic.co/u/Alexandre_Roux)\
**Post date:** [June 27, 2018, 6:08am UTC](https://discuss.elastic.co/t/5-6-8-trigerred-could-not-find-or-load-main-class-with-cp-command/137544/1 "2018-06-27T06:08:05Z")

</div>

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 :

```
-Edefault.path.logs=/opt/application/elasticsearch/logs 
-Edefault.path.data=/var/opt/data/flat/elasticsearch 
-Edefault.path.conf=/opt/application/elasticsearch/current/config

```

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
-Djna.tmpdir=/var/opt/data/flat/elasticsearch/tmp 
-Des.path.home=/opt/application/elasticsearch/current 
-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 
-Edefault.path.conf=/opt/application/elasticsearch/current/config
    
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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 25, 2018, 6:08am UTC](https://discuss.elastic.co/t/5-6-8-trigerred-could-not-find-or-load-main-class-with-cp-command/137544/2 "2018-07-25T06:08:07Z")

</div>

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