I've tried to add the Canonical Partner repository, but I still can't find the sun-java6-jdk
package. What is the right way to install the Oracle Sun JDK instead of OpenJDK on Ubuntu 10.10 (Maverick Meerkat)?

- 30,738
- 21
- 105
- 131

- 63,011
- 101
- 250
- 382
-
8http://superuser.com/ question I think. – zengr Sep 19 '10 at 22:47
-
3@zengr, I knew this was to be mentioned, but as @nulluserexception wrote, this is a programmers' question. Users (even those super) hardly care of this. Only a programmer will probably ever have such a question. – Ivan Sep 19 '10 at 22:52
-
Maybe Ubuntu stackexchange site will know why they dropped Sun Java. I guess they decided openjdk is good enough. I had no luck installing sun jdk but openjdk is fine for me. – Matthew Smith Sep 19 '10 at 23:16
-
@mattsmith as far as I know, Sun JDK is faster than OpenJDK. Eclipse works notably faster with it, for example. BTW I neer knew Ubuntu stackexchange site exists - thanks. – Ivan Sep 19 '10 at 23:36
-
@Matt @Ivan I'm not *sure* Sun Java has been dropped, I *think* (or at least hope so) it's just not available in the partner repo, yet. – Pascal Thivent Sep 20 '10 at 18:41
-
Early last year, I wrote an article for installing our free Pdf reader in Ubuntu. There I have explained how to [manually install JDK or JRE from the Java website](http://www.gnostice.com/nl_article.asp?id=182&t=How_To_Install_Free_PDF_Reader_In_Linux#install_sun_java_runtime_jre_ubuntu_linux) bypassing APT. – BZ1 Jan 13 '11 at 04:44
-
Just to add, the standard JDK are not Sun (or Oracle) Java JDK any more, it's OpenJDK. So try to avoid using Sun Java JDK. As Sun doesn't exists any more and Oracle JDK are just another implementation. – Anders Sep 11 '12 at 18:56
13 Answers
Currently the Sun Java 6 packages are working fine now for Ubuntu 10.10 and 10.04 users. It works fine for me.
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:sun-java-community-team/sun-java6
sudo apt-get update
sudo apt-get install sun-java6-jdk

- 30,738
- 21
- 105
- 131

- 912
- 1
- 6
- 6
-
4My attempt wouldn't install sun-java6 (E: Unable to locate package sun-java) so I installed it thus: sudo apt-get install sun-java6-jre sun-java6-bin – Jeff Bauer Oct 22 '10 at 21:54
-
5This worked well but indeed I also needed to use apt-get install sun-java6-jdk – Dave Drager Nov 01 '10 at 02:17
-
I tried those 3 commands, confirmed they all succeeded and then get: "Unable to locate package sun-java6" – PandaWood Dec 05 '10 at 06:18
-
2This has worked for me however I had to execute "sudo apt-get install python-software-properties" first – Mar 18 '11 at 13:04
-
Since ubuntu removed these packages from their partner repositories, you can use that repository indeed to install sun-java6-* packages. But, if you don't specificly need that package, better see: https://help.ubuntu.com/community/Java – Michiel Mar 22 '12 at 15:42
-
This does NOT work anymore. Check here => http://stackoverflow.com/questions/3747789/how-to-install-the-sun-java-jdk-on-ubuntu-10-10-maverick-meerkat/3997220#3997220 – JohnPristine Mar 30 '12 at 09:01
-
Update (2010/10/01): Yesss, Sun Java Finally Uploaded To The Ubuntu 10.10 Maverick Official Partner Repository.
Update (2010/09/27): Readers might want to check Sun Java6 Packages [updated]. I still expect official packages to be available in the partner repos at releast time though.
For an unknown reason, the sun-java6-jdk are not yet available in the partner repositories.
So either downloaded the required packages from http://archive.canonical.com/pool/partner/s/sun-java6/ and install them with dpkg -i
.
Or temporarily replace the maverick partner repository
http://archive.canonical.com/ubuntu maverick partner
by the lucid one (replace maverick
by lucid
in the above line, let me know if you need more help to do this). Then, install sun-java6. And revert the change.

- 562,542
- 136
- 1,062
- 1,124
-
I was afraid to chaotize my packages database (I've already had such unpleasant experience once) by using another version repos, and came with dpkg. Worked pretty fine (but "bin" and "jre" packages depend on each other, so I had to force). Another problem which could be caused buy versions incompatibility is that JAVA_HOME env. var was not defined automatically. – Ivan Sep 20 '10 at 18:33
-
sudo add-apt-repository ppa:sun-java-community-team/sun-java6
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-bin sun-java6-jdk
-
this is the first on the list that worked on the first try with the fewest commands. – Joshua K Mar 28 '11 at 04:12
-
Installation:
for 10.10:
sudo add-apt-repository "deb http://archive.canonical.com/ maverick partner"
for 11.04
sudo add-apt-repository "deb http://archive.canonical.com/ natty partner"
Continue with:
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin
Use as default:
sudo update-alternatives --config java
Installing JDK:
sudo apt-get install sun-java6-jdk
Source code (to be used in development):
sudo apt-get install sun-java6-source
Source of these instructions: https://help.ubuntu.com/community/Java

- 34,335
- 35
- 194
- 277
-
The advantage is that you'll automatically get the source code – AlikElzin-kilaka May 16 '11 at 06:34
All you need to do is uncomment the two lines in /etc/apt/sources.list that refer to "partner"
sudo nano /etc/apt/sources.list
# uncomment the two lines referring to "partner"
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-bin sun-java6-jdk
(I can't find the command add-apt-repository on Ubuntu 10.10, 64 amd ... even searching with apt-cache yields nothing)

- 6,662
- 4
- 37
- 57
It is working fine for me, but with a different command:
root@ubuntu:/usr/bin# sudo apt-get install sun-java6
Error message:
Couldn't find package sun-java6.
root@ubuntu:/usr/bin# sudo apt-get install sun-java*
Bam, it worked.

- 30,738
- 21
- 105
- 131

- 71
- 1
- 1
You might have to use the version in the Lucid partner repository. I did this in Lucid (I used the version from Karmic multiverse, before I realized it had been moved to the partner repo), and it worked fine. Not sure where it went in Maverick though.

- 5,151
- 2
- 29
- 29
I am assuming that you need the JDK itself. If so you can accomplish this with:
sudo add-apt-repository ppa:sun-java-community-team/sun-java6
sudo apt-get update
sudo apt-get install sun-java6-jdk
You don't really need to go around editing sources or anything along those lines.
This worked for me:
sudo add-apt-repository ppa:sun-java-community-team/sun-java6
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-jdk

- 21
- 1
For Ubuntu 10.10 Desktop simply do this: Ubuntu - Installing Java.

- 30,738
- 21
- 105
- 131

- 11
- 1
If add-apt-repository it's not working try this:
sudo apt-get install python-software-properties
That package is required in order to execute that command, in my server it wasn't installed by default (Ubuntu server x64)
Ubuntu reporsitories can be more useful
https://wiki.ubuntu.com/LucidLynx/ReleaseNotes#Sun%20Java%20moved%20to%20the%20Partner%20repository

- 995
- 7
- 19
Here are step-by-step instructions, How to install Sun Java JDK in Ubuntu 10.10 Maverick Meerkat.

- 30,738
- 21
- 105
- 131

- 11
- 1