Thursday, April 12, 2018

java - command not found - Fix for CentOS

Add the following lines after adjusting the path for your system to /etc/.bash_profile
Or simply exporting the following in the given terminal session would also work:

export JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera/bin
export PATH=$PATH:$JAVA_HOME

Log out and log in if you chose to edit the .bash_profile file. Try by entering java to see if the same error message is thrown or not.