系统里已经有jdk1.6,下载并解压jdk后,按照网上的教程(bash.bashrc)没成功。
sudo update-alternatives --install /usr/bin/java java /your/jdk/path/jdk1.8.0_121/bin/java 600
sudo update-alternatives --install /usr/bin/javac javac /your/jdk/path/jdk1.8.0_121/bin/javac 600
配置系统默认jdk:
sudo update-alternatives --config java
sudo update-alternatives --config javac