To compile versions earlier than Android 2.3, JDK 2.3 is used, but JDK 2.3 is changed to JDK. To compile versions earlier than Android, You need to compile version, therefore, jdk1.5 and jdk1.6 must be installed on the computer. The installation method is as follows:
[Java 6: For gingerbread and newer] sudo add-Apt-repository "Deb http://archive.canonical.com/lucid partner" sudo add-Apt-repository "Deb-srchttp: // archive.canonical.com/ubuntu lucid partner "sudo apt-Get updatesudo apt-Get install sun-java6-jdksudo Update-Java-alternatives-s Java-6-sun [Java 5: for froyo and older sudo add-Apt-repository "Deb http://archive.ubuntu.com/ubuntudapper main Multiverse" Sud O add-Apt-repository "Deb http://archive.ubuntu.com/ubuntudapper-updates main Multiverse" sudo apt-Get updatesudo apt-Get install sun-java5-jdksudo Update-Java-alternatives-s Java-1.5.0-sun can be set through the method below the default JDK version of the machine: sudo Update-alternatives -- config javasudo Update-alternatives -- config javac and select a number to switch to the desired JDK version. When compiling android2.3, you need to use JDK 6. Before compiling, you need to make the following settings: Export java_home =/usr/lib/JVM/Java-6-sun ---- Load the Java root directoryExport Path = $ java_home/bin: $ path ---- Set environment variables (Application Files)Export classpath = $ java_home/lib. Tools. Jar ---- Set environment variables (class files)Export java_home classpath path ---- Load the three files togetherThen you can compile it normally.