Posted by: Chyne on: November 2, 2009
Some commands that you need to know during installing Java on Linux environment:
1) Get the installation package from this command:
sudo apt-get install sun-java-6-jdk
2) Check java version
java -version
3) Check location of installed jdk
sudo update-java-alternatives -l
4)Set default java
sudo update -java-alternatives -s java-6-sun
5) Set JAVA_HOME based on location
export JAVA_HOME=/usr/lib/jvm/java-6-sun
6) Set all the environment path in /etc/environment
JAVA_HOME=/usr/lib/jvm/java
7) Set in the /etc/bash.bashrc
JAVA_HOME=/usr/lib/jvm/java-6-sun
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH
8 ) Check the environment path
env|grep PATH
If possible, requires restart the pc.