Tuesday, 3 May 2011

Sun Java as default in Ubuntu

If you're using Ubuntu  11.10 (oneiric ocelot), please check this entry. Since 11.10, Sun/Oracle's Java JDK has been removed from all (Ubuntu/Canonical) repositories.

Just to summarise the information I got from


in order to get Sun's Java Development Kit (JDK) up and running under Ubuntu (I'm using 11.04).

You may use Synaptic (the package manager) to add the "Canonical Partners" repository, reload, then find and install sun-java6-jdk.

Otherwise, open a terminal session and type the following:
sudo add-apt-repository "deb http://archive.canonical.com/ maverick partner"

sudo add-apt-repository "deb http://archive.canonical.com/ natty partner"

...depending on whether you have Ubuntu maverick (10.11) or natty (11.10). Then add:

sudo apt-get update
sudo apt-get install sun-java6-jdk
In case you had OpenJRE, OpenJDK, GCJ or similar (free, OSS Java alternatives) already in your system you may want to ensure Sun's JRE & JDK are the default. Still using the terminal, type:
sudo update-alternatives --config java
and select your preferred alternative from the list. To select a Java compiler, type
sudo update-alternatives --config javac
Now on to the testing. You should get the version numbers of the currently installed and default runtime and compiler by typing (in the terminal):
java -version
javac -version
...and that should be it.

I'd recommend you to use Geany as a source editor/IDE.

No comments:

Memory and Storage Devices

Videos related to the Computer Architecture topic (memory and storage devices) https://www.youtube.com/watch?v=NtPc0jI21i0 How a Hard Disk...