I just had trouble to install the Sun Java6 JDK after updating to Ubuntu 10.04. The problem was that the system couldn’t find the package sun-java6-sdk and apt-get gave me the message:
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jdk has no installation candidate
What I did to solve this problem was to add a new source
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
After that a normal
sudo apt-get update sudo apt-get install sun-java6-jdk
it worked for me.
Update:
Thanks for the comment of Mark Zhao. You can also update the /etc/apt/sources.list file and add/uncomment the following lines:
deb http://archive.canonical.com/ubuntu lucid partner deb-src http://archive.canonical.com/ubuntu lucid partner



by Gangadhar
20 Jul 2011 at 22:00
Awesome…Thanks a bunch
Pingback
by Install sun-java6-jdk on Ubuntu 10.04 (Lucid) « Happy Coding » The Blog of Blogs
23 Jul 2011 at 19:48
[...] http://happy-coding.com/install-sun-java6-jdk-on-ubuntu-10-04-lucid/ 23 July 2011 8:48pm – Andra bloggar – Gratis – Java – Linux – Programvara – Utveckling « 5 hemmaservrar där du når ”allt” [...]
by Ali
26 Jul 2011 at 09:44
Could explain me, How can i first download the package. And then install it off-line?
So I can install it every time without downloading again.
by Dan
30 Jul 2011 at 17:12
Yep, worked. Thanks very much
by Luke
30 Jul 2011 at 18:38
Thanks!
by deepak simaiya
31 Jul 2011 at 21:50
Thanks a alot ………nw it works…
by Rahul Aggarwal
31 Jul 2011 at 23:44
Thank you! This was very useful.
by Rob
05 Aug 2011 at 07:40
you rock :)
by Rinelko
13 Aug 2011 at 14:28
guys, after install it, i cant sudo apt-get upgrade and update. how?
Pingback
by Simplest Explanation » Blog Archive » Installing the Sun JDK in Ubuntu Linux
14 Aug 2011 at 20:06
[...] final solution was on happy-coding.com and went as so: apt-repository "deb http://archive.canonical.com/ lucid partner" sudo apt-get [...]
by kan
24 Aug 2011 at 04:04
Yes. It works. helpful post. Thanks.
by ranjith
25 Aug 2011 at 13:19
i want to install jdk
by David
26 Aug 2011 at 02:48
Thanks a lot.
=============
sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner”
=============
by Abhijit
30 Aug 2011 at 19:50
It really helped me a lot … thanks .. u rock
by meenakshi
31 Aug 2011 at 03:59
thanks a lot……. thank u sooooooo much !!!!!!!!!! it worked!
by John Goh
05 Sep 2011 at 15:30
if you can’t find add-apt-repository command, add the repository into /etc/apt/sources.list manually
by Otavio
16 Sep 2011 at 23:42
Thank you a lot
Worked just fine !!!!
Pingback
by Motor GeoEstadístico (Postgresql – Postgis – Geoserver – Openlayers – R – Grails) « abxda
17 Sep 2011 at 00:56
[...] hay que instalar el Sun JDK 6 de mas o menos aqui dice como : http://happy-coding.com/install-sun-java6-jdk-on-ubuntu-10-04-lucid/ sin olvidar cambiar la version por defecto con java alternatives [...]
by Mark Zhao
21 Sep 2011 at 01:25
The normal way is to edit /etc/apt/sources.list to uncomment out these two lines:
deb http://archive.canonical.com/ubuntu lucid partner
deb-src http://archive.canonical.com/ubuntu lucid partner
Then do
apt-get update
This will fix it forever!
by Laszlo
24 Sep 2011 at 13:03
To: Mark Zaho
Thanks so much! Your solution worked like a charm!
I just installed the latest version of Ubuntu server and just doing the ‘apt-get update’ didn’t do the trick, but after I uncommented those two lines it’s working!
Your solution should be incorporated into the main article so one does not need to pore through all the comments to find the solution ;-)
by Ashwin
02 Oct 2011 at 17:29
Solution works fine, thanks a lot
by Ramin Rezazadeh
03 Oct 2011 at 14:23
Thanks!
by Nitesh
03 Oct 2011 at 14:40
Works for me too.
by Daniel
04 Oct 2011 at 15:57
@Laszlo: Thanks. Added the tip to the main article.
by Stone
07 Oct 2011 at 03:03
Wow…you save my life!! Rock man!!
by Ping
21 Oct 2011 at 17:50
Awesome, worked perfectly on Ubuntu 11.04, thanks.
by Ping
21 Oct 2011 at 18:10
After using your fix I was able to implement the fix on website ” http://www.imlucas.com/post/263896412/ubuntu-fix-for-unable-to-locate-tools-jar-expected-to ” to solve my problem. Thanks again.
by @megatron
26 Oct 2011 at 03:27
Thanks Much. You rock.
by kiran
02 Nov 2011 at 06:34
how to execute nesc coding in ubuntu 10.04?plz explain the procedure?
by Victor
02 Nov 2011 at 12:46
Thanks!
by xiangzhuyuan
03 Nov 2011 at 15:07
thanks! well done!
by Rajesh
04 Nov 2011 at 14:06
Thanks a lot.. useful post…
by pvspain
23 Nov 2011 at 15:45
Problem with this recipe under oneiric (Ubuntu 11.10)
Edited /etc/apt/sources.list to uncomment out these two lines:
deb http://archive.canonical.com/ubuntu oneiric partner
deb-src http://archive.canonical.com/ubuntu oneiric partner
Then did..
sudo apt-get update (worked ok)
sudo apt-get install sun-java6-jdk
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package ‘sun-java6-jdk’ has no installation candidate
Is sun-java6-sdk no longer available beyond lucid?
by mickey
27 Nov 2011 at 17:28
Thank you. Very useful post. Chears from Bosnia :)