Your version is: java version "1.6.0_24".
The correct version is: Java SE 1.6.
Please follow the machine setup instructions at
http://source.android.com/source/download.html
************************************************************
build/core/main.mk:131: *** stop. Stop.
下载 Java SE 1.6.33 http://www.oracle.com/index.html
我的是32位的系统,jdk-6u33-linux-i586.bin,但流程类似,以下为参考流程,验证OK。
zhoulc@zhoulc-PC:~/work/tools$ sudo mv jdk1.6.0_33/ /usr/lib/jvm/
zhoulc@zhoulc-PC:~/work/tools$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_33/bin/java 1
zhoulc@zhoulc-PC:~/work/tools$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_33/bin/javac 1
zhoulc@zhoulc-PC:~/work/tools$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_33/bin/javaws 1
zhoulc@zhoulc-PC:~/work/tools$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/jdk1.6.0_33/bin/java 1 manual mode
Press enter to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/jdk1.6.0_33/bin/java to provide /usr/bin/java (java) in manual mode.
zhoulc@zhoulc-PC:~/work/tools$ sudo update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-6-openjdk-amd64/bin/javac 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk-amd64/bin/javac 1061 manual mode
2 /usr/lib/jvm/jdk1.6.0_33/bin/javac 1 manual mode
Press enter to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/jdk1.6.0_33/bin/javac to provide /usr/bin/javac (javac) in manual mode.
zhoulc@zhoulc-PC:~/work/tools$ sudo update-alternatives --config javaws
There are 3 choices for the alternative javaws (providing /usr/bin/javaws).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws 1061 manual mode
2 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/javaws 1060 manual mode
3 /usr/lib/jvm/jdk1.6.0_33/bin/javaws 1 manual mode
Press enter to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/lib/jvm/jdk1.6.0_33/bin/javaws to provide /usr/bin/javaws (javaws) in manual mode.
zhoulc@zhoulc-PC:~/work/tools$
To verify that the installation was successful, check Java’s version. It should now show that the Sun JDK is running instead of IcedTea:
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)
To revert the changes after Android has been compiled, run update-alternatives to switch back to OpenJDK.
参考:http://blog.163.com/zhou_411424/blog/static/197362156201211284017553/