Elasticsearch8.5.0 jar hell problem

warning: ignoring JAVA_HOME=/home/lizhibo/.sdkman/candidates/java/current; using bundled JDK
java=/home/lizhibo/elasticsearch-8.5.0/jdk/bin/java
[2022-11-10T15:23:01,353][ERROR][o.e.b.Elasticsearch      ] [node-1] fatal exception while booting Elasticsearchjava.lang.IllegalStateException: jar hell!
class: sun.applet.AppContextCreator
jar1: /usr/local/java/lib/tools.jar
jar2: /usr/local/java/jre/lib/rt.jar
        at org.elasticsearch.base@8.5.0/org.elasticsearch.jdk.JarHell.checkClass(JarHell.java:315)
        at org.elasticsearch.base@8.5.0/org.elasticsearch.jdk.JarHell.checkJarHell(JarHell.java:233)
        at org.elasticsearch.base@8.5.0/org.elasticsearch.jdk.JarHell.checkJarHell(JarHell.java:84)
        at org.elasticsearch.server@8.5.0/org.elasticsearch.bootstrap.Elasticsearch.initPhase2(Elasticsearch.java:180)
        at org.elasticsearch.server@8.5.0/org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:66)

See logs for more details.

ERROR: Elasticsearch did not exit normally - check the logs at /home/lizhibo/es-work/logs/heartbeat-es.log

ERROR: Elasticsearch exited unexpectedly

My operating system is centos7, and the version of elasticsearch is 8.5.0. The version of usr/local/java is 1.8. my question is why there is still a jar conflict between / usr/local/java when I print environment variables and use the built-in JDK of Java. How to solve the problem?

1 Like

I solved this problem by myself. I opened the DEBUG log and found that the path of the log output java.class.path contains the path of / usr/local/java. Then I set-Djava.class.path to the home directory of ES in the jvm.options file, and the problem is solved.

1 Like

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