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?