添加自己安装的JDK到选项表中
sudo update-alternatives --install /usr/bin/javac javac /root/jdk1.6.0_13/bin/javac 300
sudo update-alternatives --install /usr/bin/java java /root/jdk1.6.0_13/bin/java 300
进行默认JDK选择
sudo update-alternatives --config java
转载于:https://www.cnblogs.com/java20131201/p/3475320.html