这个问题是由混淆的 -target version 命令引起的,这种情况会在:
eclipse : 4.2.0
ADT:20.0.3
JDK : 1.6
中出现。(其他版本未测试)
官方对这个命令的解释是:
Specifies the version number to be set in the processed class files. The version number can be one of 1.0
, 1.1
, 1.2
, 1.3
, 1.4
, 1.5
(or just 5
), or 1.6
(or just 6
). By default, the version numbers of the class files are left unchanged. For example, you may want to upgrade class files to Java 6, by changing their version numbers and having them preverified.
也就是说指定要在处理类文件版本号。默认情况下,类文件的版本号不变。例如,您可能需要从1.6升级到1.7,而jar又在1.6的平台上使用,就是造成包不能导出!