Installation in the ubuntu10.10 system, the development environment needs, sometimes need to install JDK5 and JDK6, how to achieve the switch between the two? Use the Update-alternativs command to complete this task
Specific as follows:
1. Check to see if the JDK is in the Ubuntu JDK menu:
Java code
- Update-alternatives--config Java
- Update-alternatives--config Javac
2. If not in the menu can be added as follows:
Java code
- Update-alternatives--install/usr/bin/java Java/usr/lib/jvm/java/jdk1. 6.0_12/bin/java
- Update-alternatives--install/usr/bin/javac Javac/usr/lib/jvm/java/jdk1. 6.0_12/bin/javac
Note: Different versions of Jdk1.6.0_12 are subject to change
3.sudo Update-alternatives--config Java
Java code
- sudo update-alternatives--config javac
Select serial number, enter can;
4. Then java-version,javac-version view the current JDK version
JDK version switching under Linux