I have unpacked my jdk in /usr/java/.
and I put CLASSPATH, PATH, JAVA_HOME into /etc/profile like below.
export JAVA_HOME=/usr/java/jdk1.7.0_21
expor
Instructions:
which java to find the path to the Java
executable file.su - to become the root user.vi /root/.bash_profile to open the system
bash_profile file in the Vi text editor. You can replace vi with
your preferred text editor.export JAVA_HOME=/usr/local/java/ at the bottom of the file.
Replace /usr/local/java with the location found in step two.exit to close the root session.echo $JAVA_HOME to ensure that the path was set
correctly.set java_home in centos