我 遇到這個錯誤,在國外論壇看到瞭解決辦法並解決成功,希望能協助到別人。
錯誤:
build/core/product_config.mk:229: WARNING: adding test OTA key
host Java: clearsilver (out/host/common/obj/JAVA_LIBRARIES/
clearsilver_intermediates/classes)
Unrecognized option : 9999999
make: *** [out/host/common/obj/JAVA_LIBRARIES/
clearsilver_intermediates/javalib.jar] Error 41
原因:
從錯誤資訊看,大概猜出來是 java虛擬機器的問題。有人說我已經裝了java阿,但是裝了不一定能用上,"Androidrequires at least Java5 with update 12...",我裝的java 6,沒問題。
解決辦法:
裝完java 6之後
1,配置java環境變 量,我是用ubuntu8.04下的新立得裝的,預設路徑/usr/lib/jvm/java-6-sun
root使用者下開啟.bashrc檔案
#vi ~/.bashrc
在檔案末加上
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export ANDROID_JAVA_HOME=$JAVA_HOME
儲存退出
2,用update-alternatives命令更改提供java服務的正確路徑,因為我們可能裝了幾種能提供 java的服務,雖然裝了java 6,但是路徑並沒有改過來,系統還是使用原來的老路徑,所以編andr的時候會發現版本不對。
修改示 例(Ubuntu下用update-alternatives取代alternatives):
[root@vostro ~]# alternatives --config java
There are 3 programs which provide 'java'.
Selection Command
-----------------------------------------------
* + 1 /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
2 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
3 /usr/java/jdk1.6.0_07/bin/java
Enter to keep the current selection[+], or type selection number:3
[root@vostro ~]# alternatives --config javac
There is 1 program that provides 'javac'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/java-1.5.0-gcj/bin/javac
Enter to keep the current selection[+], or type selection number:
[root@vostro ~]# alternatives --config javac
There are 2 programs which provide 'javac'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/java-1.5.0-gcj/bin/javac
2 /usr/java/jdk1.6.0_07/bin/javac
Enter to keep the current selection[+], or type selection number: 2
[root@vostro ~]# javac -version
javac 1.6.0_07
[root@vostro ~]# alternatives --config jar
There is 1 program that provides 'jar'.
Selection Command
-----------------------------------------------
*+ 1 /usr/java/jdk1.6.0_07/bin/jar
Enter to keep the current selection[+], or type selection number:
把提供java,javac,jar服務的程式路徑 全部改成jdk1.6.0_07那個(我的是/usr/lib/jvm/java-6-sun/jre/bin/java),也就是*和+全部移到那個位 置,我的系統下只能改default selection,後來我把其他路徑用update-alternatives --remove刪掉了,current selection[+]也就改過來了,怎麼刪看協助。
最後重啟一下