安裝JREjava
update-alternatives --install /usr/bin/java java /usr/lib/jre1.7.0_03/bin/java 300linux
update-alternatives --install /usr/bin/javac javac /usr/lib/jre1.7.0_03/bin/javac 300vim
[root@localhost weijunping]# update-alternatives --config javatomcat
共有 2 個程序提供「java」。jvm
選擇 命令
-----------------------------------------------
*+ 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
2 /usr/lib/jre1.7.0_03/bin/javajsp
按 Enter 來保存當前選擇[+],或鍵入選擇號碼:2
[root@localhost weijunping]# update-alternatives --config javacide
共有 2 個程序提供「javac」。ui
選擇 命令
-----------------------------------------------
*+ 1 /usr/lib/jvm/java-1.4.2-gcj/bin/javac
2 /usr/lib/jre1.7.0_03/bin/javacget
按 Enter 來保存當前選擇[+],或鍵入選擇號碼:2
[root@localhost weijunping]# java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)it