for:android4.4 Source Code Compilation
Environment: UBUNTU12.04_DESKTOP_AMD64
1.
1.1. Jdk-6u45-linux-x64.bin placed in/home
1.2. Command "./jdk-6u45-linux-x64.bin"//This step is to unzip the file (if not superuser privileges, need to access the Jdk-6u45-linux-x64.bin settings)
1.3, environment variable settings: (file "/etc/environment")
1.3.1, open/etc/environment file (sudo gedit/etc/environment)
1.3.2, adding environment variables, separated by colons
Path= "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/jdk1.6.0_45/bin"
Java_home= "/home/jdk1.6.0_45"
Classpath= "/home/jdk1.6.0_45/lib"
Path is used to specify the search path for the command, because we want to use the command in the Jdk/bin directory, so we need to add the path to the environment variable path;
The classpath is used to specify the class search path;
Java_home points to the JDK's installation directory, and by setting up Java_home, there is no need for Java configuration in eclipse.
1.3.3, execute Update command
$ sudo update-alternatives--install/usr/bin/java Java/home/jdk1.6.0_45/bin/java 300
$ sudo update-alternatives--install/usr/bin/javac Javac/home/jdk1.6.0_45/bin/javac 300
$ sudo update-alternatives--install/usr/bin/jar Jar/home/jdk1.6.0_45/bin/jar 300
$ sudo update-alternatives--install/usr/bin/javah javah/home/jdk1.6.0_45/bin/javah 300
$ sudo update-alternatives--install/usr/bin/javadoc javadoc/home/jdk1.6.0_45/bin/javadoc 300
$ sudo update-alternatives--install/usr/bin/javap JAVAP/HOME/JDK1.6.0_45/BIN/JAVAP 300
(Note that the 6-line command--install followed by a total of four parameters is the link name path priority, we just modify the corresponding path is OK)
ZC: It seems that JAVA/JAVAC/JAR/JAVAH/JARDOC/JAVAP can also be set by a command similar to the following: (However, I do not use them here, test it later)
sudo ln-s-f/home/jdk1.6.0_45/bin/jar
sudo ln-s-f/home/jdk1.6.0_45/bin/javah
sudo ln-s-f/home/jdk1.6.0_45/bin/jardoc
1.3.4, if there is more than one Java in the system (such as a different version or Openjava, etc.), you need to perform:
Update-alternatives--config Java
Use this step to select the system default JDK
1.4, if necessary, restart the OS
"Linux" Ubuntu installation Jdk-6u45-linux-x64.bin