EDIT
I added this note to explain why I keep this question here. I added "Android" as keyword and I'd like to know whether someone else has tried to download the code and how it is possible to work around this problem. I fear that if I ask Ubuntu they would suggest me to use OpenJDK but the question is: did someone use that SDK to build Android code?
ORIGINAL
Sometime ago I downloaded the android source code on Ubuntu 10 64bit. I had problems but at the end I managed to get everything working. Now I'm trying to do it again on a fresh install of the same Ubuntu version but I'm having a problem.
Although I followed the instruction here I keep having the error:
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
Googling gives you a lot of results that all give you the same solution:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
I did it but it didn't work.
I'm running Ubuntu on a VM under VMWare.
I have also tried to add another source:
sudo add-apt-repository "deb-src http://archive.canonical.com/ubuntu lucid partner
but it didn't help
Maybe the answer is here:
Answer in SuperUser
but it is weird that on the Android portal there isn't any mention of it
Active firewall or antivirus software may prevent Java from installing properly. Remember to turn your firewall or antivirus software back on when you have successfully completed the Java install.
The problem is that you should now download JDK manually. Somewhere I found these steps and it worked fine in my case:
chmod a+x jdk-6u<version>-linux-i586.bin
sudo mv jdk-6u<version>-linux-i586.bin /usr/lib/jvm/
cd /usr/lib/jvm
sudo ./jdk-6u<version>-linux-i586.bin
sudo ln -s -b /usr/lib/jvm/jdk1.6<version>/jre/bin/java
/etc/alternatives/java
Append in your ~/.bashrc
JAVA_HOME=/usr/lib/jvm/jdk1.6.<version>/
PATH=$PATH:$JAVA_HOME/bin
Double-check the version java -version
Remember that you can work only with JDK v6 version.
Ensure the following:
make sure you have done sudo apt-get update
to make sure you have the latest package information.
since it says
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
you can search sudo apt-cache search sun-java6-jdk
or simply apt-cache search java6
to see what it is referred from and then install that package if it has a different name.
Also, you could always use OpenJDK instead or add a 3rd party PPA
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With