我 遇到这个错误,在国外论坛看到了解决办法并解决成功,希望能帮助到别人。
错误:
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[+]也就改过来了,怎么删看帮助。
最后重启一下