1)Installation:
1 2 | $ sudo apt-get install default-jdk $ sudo apt-get install default-jre |
2)Configuration JDK Environment:
Edit .bashrc file, and add the following settings to the end of the file:
1 2 3 | export JAVA_HOME=/usr/java/jdk1.6.0_10 (should be same with the JDK folder export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$PATH:$JAVA_HOME/bin |
If you want to make the change take effect immediately, please execute the following command in the terminal:
1 | $ source ~/.bashrc |
3)test:
1 | $ java -version |