Preface: There can be many reasons why you need Java on your system. You need Java in case you want to use Wuala, the secure peer-to-peer online storage, or Freenet, an anonymous and censor-resistant network. Or maybe you need just want to play a little browser game which requires Java.
There are several Java implementations, but the default Java implementation in Ubuntu does not always work with other software, that is why i created this specific tutorial for Sun's version of Java.
= How to install Sun Java in Ubuntu 10.04 =
First, we need to enable Canonical's so-called "partner" repository which includes popular non-free software like Skype, Google Earth or Sun Java. Afterwards we can install all those applications just like you are used to with every other application:
- Enable repository: Click Applications -> Software Centre -> In the Menubar, choose Edit -> Software Sources. Go to tab Other Software and tick the first entry ("partner"). Close and confirm the "Reload".
- In Software Centre, search for "sun java" and install the first package ("Sun Java 6.0 Plugin"). You are done!
I also created a short video tutorial with these instructions which you can watch by clicking on this image:
== Check installation ==
There are several ways to check if Sun Java is installed correctly, fire up your browser (like Firefox, Chrome, Chromium, Opera, Epiphany, ...), now:
- type into the address bar:
You should see an entry for Sun Java on this page.
- You can visit the Java test page at java.com.
- To verify your installed Java software, see Verify Installation at java.com.
- Java Tester includes links to verify your Java version and whether Java is enabled.
For Firefox-specific help, see the Mozilla Knowledgebase
== Problems ==
If you face any problems, see if other Java implementations are installed. To check this, remove those packages:
For Firefox-specific problems related with Java you can also consult the Mozilla Knowledgebase
== Multiple Java installations ==
If you have a parallel OpenJDK Java installed and want to keep it but would like to set Sun Java to be the default, execute this command:
sudo update-alternatives --set java /usr/lib/jvm/java-6-sun/jre/bin/java
=== Manually choose Java version ===
It is also possible to manually choose which Java version you want to let the system use:
sudo update-alternatives --config java
To specify the Java version for your browser plugin
sudo update-alternatives --config mozilla-javaplugin.so
== The expert way ==
If you are a command line freak, you might like this method instead:
sudo add-apt-repository "deb http://archive.canonical.com/ubuntu $(lsb_release -s -c) partner"
sudo apt-get update && sudo apt-get install sun-java6-plugin