安装多个版本JDK方法:
update-alternatives --install /usr/bin/java java “java” 优先级
update-alternatives --install /usr/bin/javac javac “javac” 优先级
例子:
update-alternatives --install /usr/bin/java java /usr/local/java/jdk1.8.0_91/bin/java 1600
update-alternatives --install /usr/bin/javac javac /usr/local/java/jdk1.8.0_91/bin/javac 1600
切换JDK版本:
update-alternatives --config java
update-alternatives --config javac