1、download jdk install file from offical website( here is oracle ) and file is .rpm;
2、extract rpm file ( here is alien which is needed to be install via cmd sudo apt-get install alien ) [b][color=red]WARNING:[/color][/b] [color=olive]$java-jdk-dir/lib/tools.pack[/color] is needed to unpacked, you can ues the tool in [color=darkred]$java-jdk-dir/bin/unpack200[/color], for more plz visit: [color=indigo]http://blog.renren.com/blog/307478166/720454333?frommyblog[/color];
3、copy dir([color=darkred]$java-extracted-dir/usr/java/$java-jdk-dir[/color]) to /usr/local/java( this dir is my favorite );[color=red]WARNING[/color]: you should [b]change mod of java-jdk-dir[/b], this is very important
4、java_home, classpath and path: you need open file /etc/profile with root user
and add the following codes before umask 022:
[color=olive] JAVA_HOME="/home/lcy/opt/jdk1.6"
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$CLASSPATH
[color=olive] export CLASSPATH[/color]
save file and close. After this ,you need do this in terminal:
sudo update-alternatives --install /usr/bin/java java YOUR-JAVA_HOME/bin/java 300
sudo update-alternatives --install /usr/bin/javac javac YOUR-JAVA_HOME/bin/javac 300
update-alternatives --config java[/color]
at last, you can check in terminal by typing:
java -version
2、extract rpm file ( here is alien which is needed to be install via cmd sudo apt-get install alien ) [b][color=red]WARNING:[/color][/b] [color=olive]$java-jdk-dir/lib/tools.pack[/color] is needed to unpacked, you can ues the tool in [color=darkred]$java-jdk-dir/bin/unpack200[/color], for more plz visit: [color=indigo]http://blog.renren.com/blog/307478166/720454333?frommyblog[/color];
3、copy dir([color=darkred]$java-extracted-dir/usr/java/$java-jdk-dir[/color]) to /usr/local/java( this dir is my favorite );[color=red]WARNING[/color]: you should [b]change mod of java-jdk-dir[/b], this is very important
4、java_home, classpath and path: you need open file /etc/profile with root user
and add the following codes before umask 022:
[color=olive] JAVA_HOME="/home/lcy/opt/jdk1.6"
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$CLASSPATH
[color=olive] export CLASSPATH[/color]
save file and close. After this ,you need do this in terminal:
sudo update-alternatives --install /usr/bin/java java YOUR-JAVA_HOME/bin/java 300
sudo update-alternatives --install /usr/bin/javac javac YOUR-JAVA_HOME/bin/javac 300
update-alternatives --config java[/color]
at last, you can check in terminal by typing:
java -version