Ubuntu 下安装 JDK6

1,下载 JDK6 到 /opt/java/jdk-6u26-linux-i586.bin

2,
chmod 755 jdk-6u26-linux-i586.bin


3,
./jdk-6u26-linux-i586.bin


4,安装完毕后,
gedit /etc/profile


5,将如下信息复制到profile文件末尾:
#set java environment 

JAVA_HOME=/opt/java/jdk1.6.0_26

export JRE_HOME=/opt/jdk1.6.0_26/jre

export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH

export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH



6,
shutdown -r now
, 重启。

7,java -version,javac -version 验证安装成功。
chen@chen-desktop:/opt/java$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
chen@chen-desktop:/opt/java$ javac -version
javac 1.6.0_26
展开阅读全文

没有更多推荐了,返回首页