


























I currently have both Java 5 and Java 6 installed on my machine and it’s very easy to switch between the two. Java 6 has some nice goodies such as JSR-223 and better jconsole that I like to use.
For Java 5:
sudo apt-get install sun-java5-jre sun-java5-jdk
For Java 6:
sudo apt-get install sun-java6-jre sun-java6-jdk
There are other packages that you might be interested in:
Verify that you have the correct version of java running:
java -version
To see a list of the java versions that you have installed, you can use the following command (it’s a letter L at the end of the command):
update-java-alternatives -l
This should show you a list of all the java alternatives you have installed. java-gcj is the free version of Java from the GNU project and comes installed by default with Ubuntu so you should see it. To switch to a different version, use the following command:
sudo update-java-alternatives -s <version-desired>
e.g:
sudo update-java-alternatives -s java-1.5.0-sun
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。