Setting variables in /etc/profile
For setting JAVA_HOME in /etc/profile enter following statements:
JAVA_HOME=/usr/java6_64/jre
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
You have to login again to see the changes. I am using putty, so will re-open it and login with root user.
Verifying variables
To verify your changes you can echo JAVA_HOME and PATH variables.
# echo $JAVA_HOME
/usr/java6_64/jre
# echo $PATH
/usr/java6_64/jre/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin
# which java
/usr/java6_64/jre/bin/java
No comments:
Post a Comment