简体   繁体   English

在ubuntu 10.04 64位操作系统上安装sun-java6-jdk

[英]installing sun-java6-jdk on ubuntu 10.04 64 bit os

I am trying to setup build enviroment for android on my ubunt10.04 machine. 我正在尝试在我的ubunt10.04机器上为android设置构建环境。 For that i want to install sun-java6-jdk as mentioned in source.andoid.com . 为此,我想安装sun.java6-jdk,如source.andoid.com中所述。

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" $ sudo add-apt-repository“deb http://archive.canonical.com/ lucid partner”

$ sudo apt-get update $ sudo apt-get update

$ sudo apt-get install sun-java6-jdk $ sudo apt-get install sun-java6-jdk

But now I am getting the error as no package for sun-java6-jdk. 但是现在我得到的错误是没有sun-java6-jdk的包。

so I want to know how to install suitable jdk for android build set up. 所以我想知道如何为android build安装安装合适的jdk。

you could install sun jdk for Ubuntu 10.04 in the same way as 10.10. 您可以像10.10一样为Ubuntu 10.04安装sun jdk。 The steps for installing java in 10.10 is described in http://java.dzone.com/articles/sun-java-6-ubuntu-1004-1010 http://java.dzone.com/articles/sun-java-6-ubuntu-1004-1010中描述了在10.10中安装java的步骤

here's the steps of installing sun jdk, taken from that article: 这是安装sun jdk的步骤,取自该文章:

add-apt-repository ppa:sun-java-community-team/sun-java6
apt-get update
apt-get install sun-java6-jdk
update-java-alternatives -s java-6-sun

in case the repository mentioned above not available anymore, here is a manual-ish alternative in installing JDK: http://codingforme.wordpress.com/2012/05/14/installing-oracle-java-jdk-6-or-7-on-ubuntu-12-04/ 如果上面提到的存储库不再可用,这里有一个安装JDK的手动替代方案: http//codingforme.wordpress.com/2012/05/14/installing-oracle-java-jdk-6-or-7 -酮的ubuntu-12-04 /

Sun JDK was dropped from Ubuntu due to licensing nonsense: http://news.softpedia.com/news/Canonical-Will-Remove-Java-From-Ubuntu-241147.shtml . 由于授权废话,Sun JDK从Ubuntu中删除: http//news.softpedia.com/news/Canonical-Will-Remove-Java-From-Ubuntu-241147.shtml Use openjdk instead. 请改用openjdk。

Although there is a ppa here https://launchpad.net/~sun-java-community-team/+archive/sun-java6 that lets you install the SunJDK, it's very out-of-date and looks abandoned. 虽然这里有一个ppa https://launchpad.net/~sun-java-community-team/+archive/sun-java6可以安装SunJDK,但它已经过时了,看起来已经被遗弃了。

Download jdk-6u45-linux-x64.bin from Oracle repository and execute the below code 从Oracle存储库下载jdk-6u45-linux-x64.bin并执行以下代码

chmod u+x jdk-6u45-linux-x64.bin
./jdk-6u45-linux-x64.bin
sudo mv jdk1.6.0_45 /opt
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.6.0_45/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/opt/jdk1.6.0_45/bin/javac" 1
sudo update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/opt/jdk1.6.0_45/jre/lib/amd64/libnpjp2.so" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/opt/jdk1.6.0_45/bin/javaws" 1

MORE ON : http://peesquare.com/blogs/install-sun-java-6-on-ubuntu-10-04-12-04-12-10-13-04-13-10-both-32-bit-and-64-bit-system/ 更多信息: http//peesquare.com/blogs/install-sun-java-6-on-ubuntu-10-04-12-04-12-10-13-04-13-10-both-32bit -and-64位的系统/

In my case, I'd rather download the required JDK directly from Sun's homepage. 就我而言,我宁愿直接从Sun的主页下载所需的JDK。 Once you download and unzip it, then all you need to do is simply adding an environment variable, JAVA_HOME. 下载并解压缩后,您只需添加一个环境变量JAVA_HOME即可。 That's it. 而已。 It is very simple and works regardless of ubuntu version. 它非常简单,无论ubuntu版本如何都可以使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM