My Ubuntu machine uses JDK 1.6 by default, but JDK 1.5 is required when compiling the Android2.2 source code, in this case, you can temporarily set JDK to 1.5 on the terminal to be compiled. The method is as follows: Create a sh file named jdk1_5.sh. The content is the installation path of your JDK1.5 as follows: exportJAVA_HOME =/home/ameyume/java/jdk1.5.0 _ 22exportJRE_HOME = $ JAVA_H
My Ubuntu machine uses JDK 1.6 by default, but JDK 1.5 is required when compiling the Android2.2 source code, in this case, you can set JDK to 1.5 on the terminal to be compiled. The method is as follows:
Create a new sh file named jdk1_5.sh. The installation path of your JDK1.5 file is as follows:
Export JAVA_HOME =/home/ameyume/java/jdk1.5.0 _ 22
Export JRE_HOME = $ JAVA_HOME/jre
Export CLASSPATH = $ JAVA_HOME/lib: $ JRE_HOME/lib: $ CLASSPATH
Export PATH = $ JAVA_HOME/bin: $ JRE_HOME/bin: $ PATH
Set the execution sequence of JDK1.5 as follows:
1. Check the current JDK version through java-version.
Www.linuxidc.com @ linuxidc :~ /Projects $ java-version
Java version "1.6.0 _ 24"
Java (TM) SE Runtime Environment (build 1.6.0 _ 24-b07)
Java HotSpot (TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
2. Execute the jdk1_5.sh file and set JDK1.5. You can add source to make it take effect.
Www.linuxidc.com @ linuxidc :~ /Projects $ source jdk1_5.sh
3. view the configured JDK version through java-version
Www.linuxidc.com @ linuxidc :~ /Projects $ java-version
Java version "1.5.0 _ 22"
Java (TM) 2 Runtime Environment, Standard Edition (build 1.5.0 _ 22-b03)
Java HotSpot (TM) 64-Bit Server VM (build 1.5.0 _ 22-b03, mixed mode)
Www.linuxidc.com @ linuxidc :~ /Projects $
It indicates that the JDK version of the current terminal has been set to 1.5. It must be noted that this setting is only valid on the current terminal and is enabled again after other terminals or the terminal is closed, JDK is still the original version 1.6. When you need a JDK environment of 1.5, You need to execute this setting every time. By writing a sh batch file, it is very convenient, and you do not need to modify the JDK configuration file.