An error in building ICS 4.0.1_r1.
target Static Jar: core-tests (out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar)
target Java: FrameworksCoreSystemPropertiesTests (out/target/common/obj/APPS/FrameworksCoreSystemPropertiesTests_intermediates/classes)error: error reading out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar; invalid header field
1 error
make: *** [out/target/common/obj/APPS/FrameworksCoreSystemPropertiesTests_intermediates/classes-full-debug.jar] Error 41
How to solve the problem?
out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar
里面有个MAINFEST.MF
最后一行是空行,所以格式错误了。删除以后,重新压缩一下,就可以了。
后来发现真正的原因是jar打包程序默认版本出问题了,于是使用如下命令查看并选择使用sun提供的jar程序进行打包。
$ sudo update-alternatives --config jar
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/fastjar 100 auto mode //原来默认使用的是fastjar,难怪出问题了
1 /usr/bin/fastjar 100 manual mode
2 /usr/lib/jvm/java-6-sun/bin/jar 63 manual mode
Press enter to keep the current choice[*], or type selection number: 2 //选择2使用sun提供的jar
update-alternatives: using /usr/lib/jvm/java-6-sun/bin/jar to provide /usr/bin/jar (jar) in manual mode.