0

在项目的 build.xml 中有一个属性

<property name="ant.build.javac.source" value="1.7"/>

它没有在 build.xml 的其他地方使用,但如果我将它的值修改为 1.6,我会

得到一个错误。

这个属性是什么意思?

我在中国,谷歌在这里被屏蔽了.....

4

2 回答 2

1

http://ant.apache.org/manual/javacprops.html

They define values for the javac (and javadoc) task since there are no default values.

This can cause problems in some circumstances, so magic properties were defined.

If you're trying to compile 1.7 source using a 1.6 compiler you'll have issues if you're using 1.7 constructs/etc.

于 2012-10-11T14:20:41.093 回答
1

The value determines what version of the JDK is used to build the project. You probably get an error on 1.6 because it's not installed/doesn't support something you use in your project.

http://ant.apache.org/manual/javacprops.html

于 2012-10-11T14:22:04.987 回答