Created 04-04-2017 09:18 AM
I have HDP 2.4. I have installed OpenJDK 1.7 as mentioned in the following link. The installation happens without any error. Step 5 in this link mentions the line 'ln -s /usr/hdp/current/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64 /usr/java/default'. I do not see any folder called JVM under /usr/hdp/current. I also executed java -version, but I still see Java RE, but no JDK. What am I doing wrong?. Also, when I execute javac, i get the error -bash: javac: command not found
Created 04-04-2017 09:27 AM
Are you sure that you added "$JAVA_HOME/bin" to your PATH variable?
export JAVA_HOME=/usr/hdp/current/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64 export PATH=$JAVA_HOME/bin:$PATH
.
Now you shoudl be able to run "javac" and "java --version"
Created 04-04-2017 09:27 AM
Are you sure that you added "$JAVA_HOME/bin" to your PATH variable?
export JAVA_HOME=/usr/hdp/current/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64 export PATH=$JAVA_HOME/bin:$PATH
.
Now you shoudl be able to run "javac" and "java --version"
Created 04-04-2017 09:34 AM
If you read my post again you will see that I had mentioned that I do not see "jvm" folder under /usr/hdp/current. So there is no folder called /usr/hdp/current/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64 in my system.
Created 04-04-2017 09:47 AM
If you have installed JDK using yum then you should check the directory:
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64
.
The inside the $JAVA_HOME/bin you should find the "javac" and "java" executables.
Created 04-04-2017 10:39 AM
the folder that I see in my machine is /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64, which I set it in the export JAVA_HOME command, but i still get the same error,i.e, it cannot find javac
Created 04-04-2017 11:14 AM
Okay. I have fixed it. I have executed the above two commands, but gave /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64 for the openJDK path. Thanks for your help 🙂