0
votes

when i try to run spark-shell i am getting the following error:

/root/apache-spark/spark-2.3.0-bin-without-hadoop/bin/spark-class: line 71: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.51-1.b16.el7_1.x86_64/bin/java: No such file or directory

I have exported the java path: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64/jre/bin/java

The above error is regarding java classpath. I need to export java classpath also. I want to know what is the default classpath for java openjdk version "1.8.0_232" on centos 7.

2

2 Answers

0
votes

You can use below command to find java home on centOS:

dirname $(dirname $(readlink -f $(which javac)))

Also I think you haven't set JAVA_HOME properly. Because spark is using some other java path than what you have specified. You can try setting JAVA_HOME in spark-env.sh Refer Environment Variables section in doc

0
votes

First, you can type java-version on the command line to see the JDK version of the current system. Second, you can type witch Java to see the JDK path. If it is not your JDK, you need to change the JDK environment variable.

Ensure that javahome= "/usr/lib/ JVM /java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64/bin" in the configuration file "spark-env.conf"

There seems to be a problem with your Java path.I hope I can help you.