First step : you need the jdk packet .where download?as following URL:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
and i down the jdk-7u17-linux-i586.tar.gz
second step: change one directory ,(as /home/(my system name)/java/jdk)uncompress the packet ,order :
点击(此处)折叠或打开
- tar zxvf jdk-7u17-linux-i586.tar.gz
then ,you will see a dirctory:jdk1.7.0_17
Third step : configure the environment.Order:
点击(此处)折叠或打开
- cd ~
- gedit .bashrc
and write the code as follows:
点击(此处)折叠或打开
- #JAVA runtime environment
- export JAVA_HOME=/home/ubuntu/java/jdk/jdk1.7.0_17
- export PATH=$JAVA_HOME/bin:$PATH
then ,you can call the console ,input;
点击(此处)折叠或打开
- java
- javac
- jar
- ....
to test.it's proof thar you are right if you see the result as follows.