Note on current Debian versions:
SunSDK has been completely removed from the partner archives and the user should move to OpenJDK instead. See also the following links:
You should install OpenJDK instead
sudo apt-get install openjdk-6-jdk
If you still want to run the Sun version:
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.
What you can also do (i did this on Debian Squeeze):
Adding non-free to the
deb http://ftp.debian.org/debian squeeze main contrib non-free
This worked for me for example in the newest Debian 6 (Squeeze) version.
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
Update 2:
Thanks to the comment of Reinier, it seems that the Sun Java Packages have been removed from the canonical-archive.
by Henry
10 Mar 2011 at 02:17
Thank mate, it worked :)
by nikhil
17 Mar 2011 at 13:26
hi there,
i am trying to install red 5 server on ubuntu lucid lynx which requires sun-java5-bin.
after searching over the net, i think that ubuntu doesn’t support sun-java instead supporting openjdk.
the solution u gave above, i thot would work for installing java5-bin as it did for java6-jdk but it eventually gives the same error : E: Couldn’t find package sun-java5-bin
please anyone help… thanks…
by ken
19 Mar 2011 at 05:40
This worked great for me on Ubuntu 10.10 32 bit, thanks for this!
by Jacob
20 Mar 2011 at 13:29
Thanx, now it works.
by Geniack
20 Mar 2011 at 21:10
Thanks, it worked :)
by Peter
24 Mar 2011 at 07:37
Why should I add the additional line before installing Java6?
Could someone explain it?
by Zdravko Tomašević
26 Mar 2011 at 20:49
Thanx !
Same problem, and after hours of searching Your solution worked!
Thanx again.
by Peter
30 Mar 2011 at 05:01
Thanks, worked a charm!
by hirin
30 Mar 2011 at 10:46
hey.. thanks, it worked for me too
by Miral_N
04 Apr 2011 at 13:00
It worked as magic :) Thaaaaaaaaaaaaaanks!
by Drew
05 Apr 2011 at 09:35
Nice one, thanks a lot!
by Doug Boehme
12 Apr 2011 at 17:08
Worked on Natty as well!
by Kelvin Hartnall
15 Apr 2011 at 01:03
Thanks! That worked for me.
by Peeyush
15 Apr 2011 at 07:21
Thanks it worked fine for me…
by evani
18 Apr 2011 at 08:26
thank u alot… it worked for me…
by Nike
18 Apr 2011 at 23:10
sudo update-java-alternatives -s java-6-sun
by SJSU
20 Apr 2011 at 07:26
thanks a ton!!!
by CV
20 Apr 2011 at 23:37
Thanks man!
by Daryl Spitzer
21 Apr 2011 at 21:06
Anyone else getting this?
$ sudo apt-get install sun-java6-jdk
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
gsfonts-x11 java-common odbcinst odbcinst1debian2 sun-java6-bin
sun-java6-jre unixodbc
Suggested packages:
default-jre equivs sun-java6-demo openjdk-6-doc sun-java6-source
sun-java6-plugin ia32-sun-java6-plugin sun-java6-fonts ttf-kochi-gothic
ttf-sazanami-gothic ttf-kochi-mincho ttf-sazanami-mincho ttf-arphic-uming
libmyodbc odbc-postgresql tdsodbc unixodbc-bin
The following NEW packages will be installed:
gsfonts-x11 java-common odbcinst odbcinst1debian2 sun-java6-bin
sun-java6-jdk sun-java6-jre unixodbc
0 upgraded, 8 newly installed, 0 to remove and 309 not upgraded.
Need to get 50.2MB/57.0MB of archives.
After this operation, 168MB of additional disk space will be used.
Do you want to continue [Y/n]?
Err http://archive.canonical.com/ lucid/partner sun-java6-bin i386 6.24-1build0.10.04.1
Connection failed
Err http://archive.canonical.com/ lucid/partner sun-java6-jdk i386 6.24-1build0.10.04.1
Connection failed
Failed to fetch http://archive.canonical.com/pool/partner/s/sun-java6/sun-java6-bin_6.24-1build0.10.04.1_i386.deb Connection failed
Failed to fetch http://archive.canonical.com/pool/partner/s/sun-java6/sun-java6-jdk_6.24-1build0.10.04.1_i386.deb Connection failed
E: Unable to fetch some archives, maybe run apt-get update or try with –fix-missing?
Pingback
by iT Geeks » Java install on Ubuntu
21 Apr 2011 at 21:53
[...] 1http://happy-coding.com/install-sun-java6-jdk-on-ubuntu-10-04-lucid/ [...]
by Daniel
21 Apr 2011 at 22:16
And an apt-get update didn’t fixed this?
Pingback
by Ubuntu に Android 開発環境を構築する | Android.A-Yan.com
01 May 2011 at 12:35
[...] http://happy-coding.com/install-sun-java6-jdk-on-ubuntu-10-04-lucid/ [...]
by krishnakanth
02 May 2011 at 16:55
thnx a lot ….it worked!!
by Vividh
03 May 2011 at 10:49
Thanks…It worked….!
by John
06 May 2011 at 11:32
Cheers, i have been looking everyone for this solution!
Many thanks!
by jonan
08 May 2011 at 17:28
thx for sharing man
by Alberto
09 May 2011 at 13:08
Worked Perfect!
Thanks!
by Daniel
10 May 2011 at 14:47
Cool! :D
by sriram
13 May 2011 at 20:33
how to set a classpath for JAVA_HOME
(all class path for Servlet,JSP and JDBC using ORACLE DB)
by Jusuf
16 May 2011 at 01:45
Thanks.
by pep
20 May 2011 at 14:24
Gracias, funciona muy bien.
by Ajay
27 May 2011 at 10:44
If not solved … here is a clean description. Step by Step given
http://android-eclipse.blogspot.com/2011/05/failed-to-get-adb-version-cannot-run.html
by Nguyen Van Tam
27 May 2011 at 15:17
worked perfect !
Thanks!
by Dhonnee Manalo
30 May 2011 at 16:26
Thanks. It worked with AMD64 Ubuntu 10.10.
by john
04 Jun 2011 at 00:11
it worked. Tnks!!!!
by haoleit
04 Jun 2011 at 12:59
On Lucid (server)
sudo apt-get install python-software-properties
sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner”
sudo apt-get update
sudo apt-get install sun-java6-jdk
by kishor lohare
10 Jun 2011 at 18:08
works fine.
Thanks !
by KJ
12 Jun 2011 at 17:06
Thanks mate! worked perfectlyy
by Arun Kumar Arjunan
14 Jun 2011 at 13:24
That worked
by Etcho
15 Jun 2011 at 19:45
Thanks! Saved me here!
by rashmani
17 Jun 2011 at 19:50
Thanks Man, it worked a charm!
Ubuntu 10.4 64bit
rash*
by Ram
28 Jun 2011 at 10:33
Yes it works! actually this path is already in the repository list of ubuntu, you just have to uncomment it…..
/etc/apt/sources.list
by Jon
28 Jun 2011 at 18:02
Thank you. I’m in the middle of swamp of horrible installations and this really helped me out.
by Asim
29 Jun 2011 at 08:41
Hey bro, thanks a million it worked first time after days of searching for a solution.
by Diego
29 Jun 2011 at 15:54
Q bien, me fue de gran ayuda, gracias, q buen aporte
by Marco
01 Jul 2011 at 04:37
thanks ! :-)
by chathura
05 Jul 2011 at 06:34
Thanks mate!it worked
by Shrek
13 Jul 2011 at 02:51
Sweet
by Dillon Chaffey
19 Jul 2011 at 06:15
Thanks mate. I had ran out of ideas when I fortunately discovered this post. It worked for me!
by Sreeraj
19 Jul 2011 at 19:16
Thanks Man.it Worked