This is replication of blog written by dshuck on Mar-21-09 6:32am
From: daveshuck.instantspot.com
To install Oracle/Sun Java please refer to How to install Java in Ubuntu post.
Here I discuss, how to set JAVA_HOME variable and the PATH variable to your Java installation.
First using the terminal open the .bashrc which is at your home.
Now run,
To install Oracle/Sun Java please refer to How to install Java in Ubuntu post.
Here I discuss, how to set JAVA_HOME variable and the PATH variable to your Java installation.
First using the terminal open the .bashrc which is at your home.
Now add the following to the end of the file.gedit ~/.bashrc
JAVA_HOME=/usr/lib/jvm/javaNOTE: If /usr/lib/jvm/java does not match the actual JAVA_HOME path in your environment, then set the actual JAVA_HOME, where you have installed Java in your machine.
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH
Now run,
source ~/.bashrcThen, try running the following commands and check whether your getting the appropriate responses:
echo $JAVA_HOMEIf it not work try after restarting
/usr/lib/jvm/java
echo $PATH:/usr/lib/jvm/java/bin