Ubuntu install jdk6

install the latest jdk1.6 in ubuntu
I just dont know how to do it?
when i type java, the terminal will give me the answer like this
sun-jdk or open-jdk,
I do not remember now.

First, if you want to install the latest version of java. go to the sun's official site
now, I download the jdk-6u7-linux-x64.bin my system is 64 bit.

I first create a java folder in /usr , /usr/java
cd /
sudo mkdir /usr/java


copy the jdk-6u7-linux-x64.bin to /usr/java
sudo cp (jdk-6u7-linux-x64.bin's full path) /usr/java
sudo chmod a+x jdk-6u7-linux-x64.bin
sudo ./jdk-6u7-linux-x64.bin

then, install it

cd /
open the /etc/profile
sudo gedit /etc/profile
or
sudo vi /etc/profile


before the umask 022
insert this sentence below

JAVA_HOME=/usr/java/jdk1.6.0_07
JRE_HOME=/usr/java/jdk1.6.0_07/jre
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME PATH CLASSPATH


type
echo $PATH
to see the setting
java
at last, restart the system, if it do not active.

你可能感兴趣的:(java,jdk,linux,ubuntu,sun)