android在编译源代码的时候不需要配置相应的jdk,而在编译sdk的时候,当sdk版本不兼容的时候


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 apt-get update$ sudo apt-get install sun-java6-jdk

Java 5: for Froyo and older

$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy main multiverse"$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy-updates main multiverse"$ sudo apt-get update$ sudo apt-get install sun-java5-jdk

明确要求java的sdk要求不同。


所以需要使用 update-alternatives --config  这个命令来配置,配置的文件主要  java,javac,javadoc,javah,jar 这5个命令