Penguin

JDK is the Java Development Kit, A software development package from Sun Microsystems that implements the basic set of tools needed to write, test and debug Java applications and applets.

Ubuntu Edgy 6.10

First we make sure that the backport repository is available in our sources.list

Use your favourite text editor to open up the sources.list.

  • sudo vim /etc/apt/sources.list

Make sure the following two lines are not commented out (Commented out means that the line begins with a '#' character):

deb http://nz.archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse
deb-src http://nz.archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse

If you also would like to install the Eclipse IDE, then make sure the universe repository is available on the sources.list file.

deb http://nz.archive.ubuntu.com/ubuntu/ edgy universe
deb-src http://nz.archive.ubuntu.com/ubuntu/ edgy universe

Save the sources.list.

Now we need to update our list of available packages from the apt sources.

  • sudo aptitude update

Now we download and install Java 1.6.

  • sudo aptitude install sun-java6-jdk

There is a fair bit to download so hopefully you are no longer using dial-up :) A few license agreements will pop-up, just choose OK.

Now that is done we need to make sure that we are using the correct version of java.

  • sudo update-alternatives --config java

You will see a few alternatives. Select the option that has java-6-sun in the java path.

Now we will do the same thing for the compiler:

  • sudo update-alternatives --config javac

Once again select the alternative with java-6-sun in the path.

For those who wish to use the Eclipse IDE.

  • sudo aptitude install eclipse

Start up eclipse with the command

  • eclipse &

Head to your workbench and then File --> New --> Project Choose java project. and click next.

In the JRE section, if your default is not set at java-6-sun-1.6.0.00

Click configure JREs Click the add button and browse to /usr/lib/jvm Choose java-6-sun-1.6.0.00 (There may be some other symbolic links you can choose also) and click OK. Make sure that java-6-sun-1.6.0.00 has a tick next to it.

Good now we will set up the JDK compliance Level. Click the dropdown box next to the text compiler compliance level and choose 6.0. Click OK.

You should be all ready to start coding in java!