Ubuntu Breezy: Installing Java and Eclipse

Yesterday, I got my usual Java development environment setup on my laptop which is running Ubuntu Breezy (Breezy is the nickname for version 5.10). It was rather confusing because Ubuntu itself is far from being a consumer OS and googling only turns up confusing and incomplete information.

Here it is:

Installing Java

  1. Enable extra repositories.

Ubuntu, and Linux in general, has utilities (i.e. apt-get) that'll download software from repositories on the Net by name. Steps below requires some files from one or more repositories which are not enabled by default installation of Ubuntu so you'll have to enable it.

Easiest way for me to do this was by using Ubuntu Add Applications GUI panel.

a. Select menus: System >> Administration >> Add Applications.

b. When the panel opens, select menus: Settings >> Repositories.

c. Click Add button.

d. Enable Community maintained (Universe) and Non-free (Multiverse) checkboxes.

e. Click OK, another OK, and Close.

2. Install Ubuntu java-packages package. 

This package is apparently need to convert Sun's JDK installer into Debian installation package. Why? Because Linux world still hasn't got their act together and think this sort of nonsense is acceptable to consumer. Anyway, just shake your head and move on.

a. Open Terminal window (Applications >> Accessories >> Terminal).

b. Type this nonsense in:

sudo apt-get install java-packages

c. Leave the Terminal window open for later steps.

3. Install Sun's JDK package

Java support available via Ubuntu's package download utility is not fully compatiable with latest Eclipse. So Sun's JDK has to be used.

a. Download Sun's JDK.

I've opted for JDK 5.0 which is the latest version. Download the regular bin version, not the RPM version. Save it somewhere (another gnomish UI confusion/hassle suckage). I just used Firefox to save to Desktop then dragged it to my home directory via file manager UI.

b. Run it (eyeroll).

Following nonsense is a perfect illustration of how blinded and clueless Linux geeks are about normal computer users. Since this is an instruction, I'll just move on.

Switch to that directory from the previously opened Terminal window and type this in:

chmod +x {downloaded_file_name}.bin

fakeroot make-jpkg {downloaded_file_name}.bin

sudo dpkg -i {file_created_from above}.deb

The first line gives the .bin file execution privileage. The second line converts .bin into .deb, a Debian version of the installation package. The last line runs it.


p dir=”ltr”>c. Set Sun's JDK as the default java VM.

If you can figure out where one sets system-wide environment variable, set JAVA_HOME and PATH appropriately. If not, use this. I don't know exactly all the things it does, but it does the job for me. *shrug*

Type into Terminal:

sudo update-alternatives –config java

java -version

d. If you see blah blah about Sun's JVM, then you are home. If not, something went wrong and, if you are not a Linux geek, marry one.

Installing Eclipse, Tomcat, and MyEclipse

Just download and open the Eclipse SDK, extract it into tmp directory, then move it to where you want it. What then? Well, run it. Double-clicking on the eclipse file in a file manager view will do the job.

Do the same with Tomcat except there is nothing to run. Just remember where you moved it to.

Now, download MyEclipse for Linux. Give it execution privileage (chmod +x bit above) then run it. MyEclipse installer will ask for location of Eclipse and where to install MyEclipse.

Launch Eclipse again, enable Tomcat under Application Server preference and point to Tomcat installation location.

That's it.