Compile android source code 3 --- install JDK 6 on ubuntu
For Android 2.3 and later versions, JDK 6, that is, JDK 1.6, must be used instead of copying files to/urs/lib/jvm.
Cd download
Sudo su
Sudo cp jdk-6u45-linux-x64.bin/usr/lib/jvm
2. jdk-6u45-linux-x64.bin File Installation
# Chmod 777 jdk-6u45-linux-x64.bin grants the current user permission to execute
#. Jdk-6u45-linux-x64.bin.bin
3. Change the environment variable 4. Configure the default JDK version
Sudo update-alternatives -- install/usr/bin/java/usr/lib/jvm/javaxxx/bin/java 300
Sudo update-alternatives -- install/usr/bin/javac/usr/lib/jvm/javaxxx/bin/javac 300
Sudo update-alternatives -- install/usr/bin/jar/usr/lib/jvm/javaxxx/bin/jar 300
Sudo update-alternatives -- install/usr/bin/javah/usr/lib/jvm/javaxxx/bin/javah 300
Sudo update-alternatives -- install/usr/bin/javap/usr/lib/jvm/javaxxx/bin/javap 300
Run sudo update-alternatives -- config java
Switch to jdk 1.6.0 _ 45