Wednesday, September 18, 2013

Command to Reset $JAVA_HOME in linux

Some times we need to change the $JAVA_HOME i our linux environment.

Goto Terminal and open either of the following files using an editor of your choice (vim, nano, etc):

# nano /etc/profile
or
# nano /root/.bash_profile 

(Instead of root you can also change your normal username.)

Then

#export JAVA_HOME=/home/user/jdk1.7.0_02/
#export PATH=$PATH:$JAVA_HOME/bin


After executing this command just execute the below command to check the current home:


#java -version

No comments: