Ant使用-source 7或更高版本来启用钻石操作员

Ant使用-source 7或更高版本来启用钻石操作员

问题描述:

我确信这很简单,但我仍然坚持使用命令行中的Ant构建Android应用程序。
我收到此消息:(使用-source 7或更高版本启用钻石操作员)。我将什么添加到构建文件以使其使用Java 1.7进行编译?

I am sure this is pretty easy qoestion, but I am stuck with building Android app using Ant from commandline. I have got this message: (use -source 7 or higher to enable diamond operator). What do I add to buildfile to make it compile using Java 1.7?

解决了它,如果其他人被困在这个上。
我必须更改< import file =$ {sdk.dir} /tools/ant/build.xml/> 文件。
有属性
< property name =java.targetvalue =1.5/> < property name =java.sourcevalue =1.5/> ,值应更改为1.7

Solved it if anyone else is stuck on this one. I had to change <import file="${sdk.dir}/tools/ant/build.xml"/> file. There are properties <property name="java.target" value="1.5" /> <property name="java.source" value="1.5" /> and the values should be changed to 1.7