Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have followed the instructions on numerous pages, such as this, which say to run the following commands:

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk

However, when I do this I still get the following error:

me@mycomputer:~$ 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

I realize Java is available from many other sources, but for reasons that I can't get into here I must use this specific version.

What can I do to get this installed?

share|improve this question
    
you can install it manually using this link askubuntu.com/questions/67909/how-do-i-install-oracle-jdk-6 –  Mansoor Elahi Nov 20 '12 at 10:03
add comment

6 Answers

The Sun/Oracle JDK package is no longer available in Ubuntu due to Oracle retiring the 'Operating System Distributor License for Java'. Story here.

Originally Canonical were going to make it so that existing installations of Sun's JRE/JDK would get removed on an apt-get update, but they reversed that decision (however updates/installs will no longer be available).

The recommendation is for users to transition to the OpenJDK 6 package. You can still install the Oracle JDK by downloading from Oracle's website, but it has to be done manually.

share|improve this answer
    
Does OpenJDK exist for 10.04? –  dfrankow Dec 20 '12 at 20:47
    
@dfrankow Seems like it according to the package list, though don't know how up-to-date it is. –  prunge Dec 20 '12 at 21:56
    
Turns out openjdk-6-jdk was available, but did not do what I wanted. It was too early in its dev cycle. I ended up using Sun's jdk from superuser.com/a/439915/56544. –  dfrankow Dec 21 '12 at 20:52
add comment

Also, you might find this blog post helpful. It worked for me and was totally painless (script install vs building your own Java package):

You can find the script and full usage instructions on github.

The quick and dirty guide for using this script is as follows:

cd ~/
wget https://github.com/flexiondotorg/oab-java6/raw/master/oab-java.sh -O oab-java6.sh
chmod +x oab-java6.sh
sudo ./oab-java6.sh
sudo apt-get update && sudo apt-get install sun-java6-jdk
share|improve this answer
add comment

The following command should help you get sun jdk6 in ubuntu 10.04

sudo add-apt-repository ppa:sun-java-community-team/sun-java6
sudo apt-get update
sudo apt-get install sun-java6-jdk
sudo update-java-alternatives -s java-6-sun
share|improve this answer
3  
Thank you for the suggestion, but I couldn't get this to work on Ubuntu 12.04 LTS –  SSH This Oct 22 '12 at 21:52
    
This worked for me on 10.04, which was helpful. –  dfrankow Dec 21 '12 at 20:55
add comment

There are really good instructions for building your own sun-java packages here:

https://github.com/rraptorr/sun-java6

The packages work great for me in Ubuntu Lucid 10.04 x64/i386.

share|improve this answer
add comment

Install OpenJDK instead

sudo apt-get install openjdk-6-jdk

share|improve this answer
add comment

sudo apt-get install openjdk-6-jdk

worked fine for me on ubuntu 10.04

thanks.

share|improve this answer
1  
QA wants Sun Java not OpenJava. –  Lorenzo Von Matterhorn Apr 1 '13 at 22:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.