# Error: Could not find or load main class org.elasticsearch.tools.JavaVersionChecker for install of s3 plugin

**URL:** <https://discuss.elastic.co/t/error-could-not-find-or-load-main-class-org-elasticsearch-tools-javaversionchecker-for-install-of-s3-plugin/162212>\
**Category:** Elasticsearch\
**Created:** [December 27, 2018, 8:03am UTC](https://discuss.elastic.co/t/error-could-not-find-or-load-main-class-org-elasticsearch-tools-javaversionchecker-for-install-of-s3-plugin/162212 "2018-12-27T08:03:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Santosh\_B](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@Santosh\_B](https://discuss.elastic.co/u/Santosh_B)\
**Post date:** [December 27, 2018, 8:03am UTC](https://discuss.elastic.co/t/error-could-not-find-or-load-main-class-org-elasticsearch-tools-javaversionchecker-for-install-of-s3-plugin/162212/1 "2018-12-27T08:03:14Z")

</div>

While building Docker file, installation of elasticsearch-plugin fails with "Error: Could not find or load main class org.elasticsearch.tools.launchers.JavaVersionChecker". It fails for ElasticSearch 6.4.x and 6.5.x versions.

I have seen previous links and blogs mentioned in the below links.

- [Error: Could not find or load main class org.elasticsearch.tools.JavaVersionChecker](https://discuss.elastic.co/t/error-could-not-find-or-load-main-class-org-elasticsearch-tools-javaversionchecker/82213/11)
- [Could not find or load main class org.elasticsearch.tools.launchers.JavaVersionChecker](https://discuss.elastic.co/t/could-not-find-or-load-main-class-org-elasticsearch-tools-launchers-javaversionchecker/120046)
- [https://github.com/elastic/elasticsearch/issues/27599](https://github.com/elastic/elasticsearch/issues/27599)

According to the above links, have changed the owner given the necessary permissions and running as non-root user. VM and jvm are both 64 bit.

The same Docker file we were using it for 5.6,6.2 and 6.3 versions of ElasticSearch. It fails for 6.4 and 6.5 versions of ElasticSearch. DockerFile is below.  
FROM $BASE\_IMAGE  
ARG ELASTICSEARCH\_VERSION=6.4.0  
ENV ELASTICSEARCH\_VERSION $ELASTICSEARCH\_VERSION  
ENV LOCK\_ALL true

# default value for PATH\_REPO\_LOCATION based on dir created

ENV PATH\_REPO\_LOCATION /opt/ca/elasticsearch/backup  
ENV ZEN\_MINIMUM\_MASTER\_NODES 2  
WORKDIR /opt/ca  
ADD docker/startElasticsearch.sh .  
USER root

# Download and install Elasticsearch

RUN yum install -y wget unzip dos2unix libcgroup-tools &&   
wget [https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ELASTICSEARCH\_VERSION.zip](https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-%24ELASTICSEARCH_VERSION.zip) &&   
unzip elasticsearch-$ELASTICSEARCH\_VERSION.zip &&   
rm -f elasticsearch-$ELASTICSEARCH\_VERSION.zip &&   
mv elasticsearch-$ELASTICSEARCH\_VERSION /opt/ca/elasticsearch &&   
cd /opt/ca/elasticsearch/lib &&   
mkdir -p $PATH\_REPO\_LOCATION &&   
mkdir -p /var/log/elasticsearch &&   
mkdir -p /var/data/elasticsearch &&   
chown -R 1010 /opt/ca &&   
chown -R 1010 /var/data/elasticsearch &&   
chown -R 1010 /var/log/elasticsearch &&   
chown -R 1010 $PATH\_REPO\_LOCATION &&   
chmod -R 777 $PATH\_REPO\_LOCATION &&   
echo "vm.max\_map\_count=262144" \>\> /etc/sysctl.conf &&   
echo "fs.file-max = 65536" \>\> /etc/sysctl.conf &&   
yum clean all  
RUN os\_type=`uname -p` && if [["$os\_type" == "s390x"]];   
then echo " bootstrap.system\_call\_filter: false" \>\> /opt/ca/elasticsearch/config/elasticsearch.yml;   
sed -i "/8:-Xloggc:logs/gc.log/d" /opt/ca/elasticsearch/config/jvm.options;   
fi

# Download and install S3 Repository Plugin

COPY elasticsearch-env /opt/ca/elasticsearch/bin/elasticsearch-env  
RUN chown -R 1010 /opt/ca/elasticsearch/bin  
RUN chmod -R 777 /opt/ca/elasticsearch/  
USER 1010  
RUN /opt/ca/elasticsearch/bin/elasticsearch-plugin install --batch repository-s3  
VOLUME ["/var/log/elasticsearch", "/var/data/elasticsearch", "/opt/ca/elasticsearch/backup"]

Have run the strace command and below is the output.  
strace /usr/bin/java -cp 'lib/\*' org.elasticsearch.tools.JavaVersionChecker

---

<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:** [January 24, 2019, 8:03am UTC](https://discuss.elastic.co/t/error-could-not-find-or-load-main-class-org-elasticsearch-tools-javaversionchecker-for-install-of-s3-plugin/162212/2 "2019-01-24T08:03:17Z")

</div>

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