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

Asked by eval-

As per http://source.android.com/download 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 sun.com.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu sun-java5 Edit question
Assignee:
No assignee Edit question
Solved by:
Przemek K.
Solved:
Last query:
Last reply:
Revision history for this message
George Standish (george-standish-deactivatedaccount) said :
#1

eval-

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

System / Administration / Software Sources -- Other Software tab -- check "http://archive.canonical.com/ubuntu 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,
George

Revision history for this message
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.")

Revision history for this message
George Standish (george-standish-deactivatedaccount) said :
#3

eval,

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,
George

Revision history for this message
George Standish (george-standish-deactivatedaccount) said :
#4

eval,

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.

George

Revision history for this message
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.)

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

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.

Revision history for this message
Przemek K. (azrael) said :
#7

You can also try the debs from Ubuntu 9.04.
http://packages.ubuntu.com/jaunty-updates/sun-java5-jdk

Revision history for this message
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?

Revision history for this message
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:
http://blog.enea.com/Blog/bid/32050/Ubuntu-9-10-Java-5-and-the-Android-Open-Source-Project

Or you can just use the source package from Jaunty and rebuild this package for Lucid.
See
http://unixmania.blogspot.com/2010/01/sun-java5-plugin-for-seamonkey-on.html
and
http://www.schnuckelig.eu/blog/sun-java-5-ubuntu-karmic-20091123

Revision history for this message
eval- (eval-) said :
#10

Thanks Przemysław Kulczycki, that solved my question.

Revision history for this message
Przemek K. (azrael) said :
#11

According to http://developer.android.com/sdk/index.html Android SDK will run on JDK6.

Revision history for this message
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.