Ubuntu12.04 install JDK 1.8.0_05

1:下载jdk-8u5-linux-x64.tar.gz

2:cd /usr/local mkdir java  

3: tar -zxvf jdk-8u5-linux-x64.tar.gz -C java

4: 修改/etc/profile文件 

    export JAVA_HOME=/usr/local/java/jdk1.8.0_05

    export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

    export PATH=$PATH:$JAVA_HOME/bin

    export JAVA_HOME CLASSPATH PATH

5:update-alternatives --install /usr/bin/java java /usr/local/java/jdk1.8.0_05/bin/java 1

6:java -version



你可能感兴趣的:(Ubuntu12.04 install JDK 1.8.0_05)