Ubuntu10.10搭建Android开发环境

Installing the JDK

The Sun JDK is no longer in Ubuntu's main package repository. In order to download it, you need to add the appropriate repository and indicate to the system which JDK should be used.

Java 6: for Gingerbread and newer

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


最后设置JAVA环境
ln -s /usr/lib/jvm/java-6-sun/bin/javac   /etc/alternatives/javac 
ln -s /usr/lib/jvm/java-6-sun/bin/java     /etc/alternatives/java

ln -s /usr/lib/jvm/java-1.5.0-sun/bin/javac   /etc/alternatives/javac 
ln -s /usr/lib/jvm/java-1.5.0-sun/bin/java     /etc/alternatives/java
sudo ln -s /usr/lib/jvm/java-1.5.0-sun/bin/javadoc /etc/alternatives/javadoc

$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
java -version
javac -version

你可能感兴趣的:(jdk,ubuntu)