Installing Sun's JDK 6 On Ubuntu
By Roman Strobl on VI 05, 2007
I installed the latest release of Ubuntu - 7.04 on my home computer. I am quite happy with it, however I am a bit disappointed that Sun's Java is still not available by default. The default Java is GCJ, which unfortunately is not 100% Sun java compatible. So how to exchange GCJ for Sun Java?
- You can find out where is java installed by running "which java".
- The version can be determined by running "java -version".
- To install Sun's JDK 6, switch to root and run "apt-get install sun-java6-jdk". You can also run sudo if you don't want to switch to root: "sudo apt-get install sun-java6-jdk".
- Proceed with the installation and confirm the license terms.
- Now you should get the correct message when running "java -version":
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
I hope that Sun's Java will become default in Ubuntu soon. Not sure if there are any reasons why it should not be the default, now that it's fully open source. The experience will be much better for beginners who may run into problems with GCJ because it doesn't support all Java applications at this moment.