I recently had to do some work on Sakai 2.4 but was having trouble building and running it in Java 1.6. This gave me the chance to blow away and re-install an old PC I had lying around, with the latest version of Ubuntu (10.04). However, with the default software source repositories, it only supports Java 1.6 (and prefers OpenJDK too). Here’s how to get Sun Java 1.5 installed on Ubuntu 10.04:
Add the following to /etc/apt/sources.list:
Update the package list:
Install Sun Java 1.5:
Depending on your setup you might need to set this as the default. Check what version is default:
And list all Java versions installed:
Then if necessary:
If you want to get Sun Java 1.6 installed, instead of OpenJDK, just enable the partner repositories in the Package Manager > Software Sources and it will show up in the list for you to install.
Thanks a lot. I needed a java5 sdk for running scrumworks on one of our 10.04 virtualmachines. This helped a lot!
Thank you – needed this for Android build.
Thank you so much! I also needed this for an Android build.
You saved my day…
thanks, needed this to build android froyo
thanks, you saved my day; need this for repo (android)
On Ubuntu 10.04
>> sudo apt-get install sun-java5-jdk
gives error : Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Can you suggest what could be going wrong with my setup?
Thanks
JP
Steve, stacks of thanks for posting this. I’m working on a CMS (liferay offshoot) that’s requiring Java 5. You just save my day, brother.
One more vote of thanks. Also working on Android froyo using Ubuntu 10.04.
Gracias al final me ha servido.
Many Thanks..Steve Swinsburg
– Uditha Madumal
@ steve on sakai:thank u so much ur instructions…i was able to install java 5 successfully…thank u !!!!
Great post, thanx a lot
-Mattias, Sweden
Thanks a lot!
Thanks! This tip also works in Ubuntu 10.10
Thanks, Steve! This also works in Ubuntu 10.10 without any problem.
thanks a lot .. i m new to Android and ubuntu. This helped a lot.
Thank you so much! I can install the Java1.5 on ubuntu10.10
Thanks!It worked and I find useful too the "updates alternatives" part.Thanks again
Thanks a lot for sharing your finding!
You might have to switch the repo to hardy as it’s an LTS. Most of the jaunty repos are gone now, but you can still pull this from hardy.
deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse
deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates multiverse
Thank you a lot. Using package sources from comment of Matt Jones.