How does one install sun-java5-jdk in Lucid? It is required (6 is not supported) to build Android.

Asked by eval- on 2010-04-26

As per the Java 5 update 12 or higher JDK is required to build Android. Java 6 is not supported. I would like a nice easy way to do this on Lucid. It seems you have to provide e-mail and request a download link just to get the Java5 JDK from

Question information

English Edit question
Ubuntu sun-java5 Edit question
No assignee Edit question
Solved by:
Przemek K.
Last query:
Last reply:


You need to add the Partner repository to install Sun's version of Java.

System / Administration / Software Sources -- Other Software tab -- check " lucid partner" -- update your apt, press the Reload button after making above change or "sudo apt-get update", then you should find: sun-java6-jre or sun-java6-jdk and the sun-java6-plugin web plugin

Good luck,

eval- (eval-) said : #2

I have already done so. It does not have java5-jdk which is needed to build Android. 6 is not supported. ("because of incompatibilities with @Override.")


I'm so sorry! You're looking for Java 5 - which my above answer doesn't address at all!

Sorry for the misleading info.

Best of luck,


That was really bad timing, my page hadn't updated with your reply, so the question appears answered again. Add another comment to it returns to Open to gets more attention.


eval- (eval-) said : #5

It's OK. I will probably write a small script to set the right PATHs and other things for this build environment, since I cannot use update-java-alternatives with Sun's Java5 JDK self-extracting .bin, which they just e-mailed me the download-link of.

I will eventually get it working, but it would be nicer to have an easier solution for Lucid.

The unavailability of older packages (for example kernel 2.6.31) on Lucid is becoming a problem for me (2.6.32 breaks atmel wireless usb on my desktop and intel gma 4500 3d rendering on my laptop.)

You could find an old deb for the version you need laying around on the web some place but it will be hard to find.

I personally always use the .bin file as I use 64bit OS and like the native 64bit plugin. The java from the repos installs 32bt sun java then makes it run via nspluginwrapper which is 64bit.

If lucid does not make your hardware work then log bugs and they will hopefully get addressed. You may have to run Karmic for a while or forever until they get ironed out. Intel vga always has issues when a new release is kicked out which is one reason why I personally avoid their chips.

Przemek K. (azrael) said : #7

You can also try the debs from Ubuntu 9.04.

eval- (eval-) said : #8

I was able to use the .bin, because it looked like I'd have to import a number of things from 9.10 to use old debs.

But none of these solutions are optimal or in many cases even workable for the average user. Building Android proves to be simpler than getting sun-java5 into Lucid.

Is there any chance sun-java5 will be supported in Lucid?

Best Przemek K. (azrael) said : #9

I dont think so. Java 5 is officially EOLed and even EOSLed by Sun. See Bug #418577.
You can use Jaunty's repos to install Java 5 as in this blog post:

Or you can just use the source package from Jaunty and rebuild this package for Lucid.

eval- (eval-) said : #10

Thanks Przemysław Kulczycki, that solved my question.

Przemek K. (azrael) said : #11

According to Android SDK will run on JDK6.

Alain Kalker (miki4242) said : #12

Sorry to pick a nit here (this comment is only an addition, not re-opening the question) which appears to me to be specifically about building Android (the OS, not just a single Android app).

While the SDK may work with JDK 5 or 6, the full Android build environment works ONLY with Java 5 (at least for building Eclair). The 'm' series of commands all do a build tools version check, and error out if the JDK isn't version (1.)5.