[英]Visual Studio 2012 + Ant: diamond operator is not supported in -source 1.5
There are many similar questions with regards to setting the language level for Java when performing an Android build. 关于在执行Android构建时为Java设置语言级别,存在许多类似的问题。 But all of these answers show you how to set the language level in Eclipse or NetBeans or Android Studio .
但是所有这些答案都向您展示了如何在Eclipse或NetBeans或Android Studio中设置语言级别。 I am using Nsight Tegra-Android in Visual Studio 2012 building using Ant and I don't see anywhere in Project->Properties that I can change the language level.
我在使用Ant的 Visual Studio 2012中使用Nsight Tegra-Android,并且在Project-> Properties中看不到可以更改语言级别的任何地方。
I have CodeWorks for Android 1R4 installed which is the latest and the paths I have set up are to the following packages: 我已经安装了适用于Android 1R4的CodeWorks,它是最新的,并且我设置的路径是以下软件包:
NDK R10e NDK R10e
JDK 1.7.0_71 JDK 1.7.0_71
Ant 1.8.2 蚂蚁1.8.2
which are specified under Tegra->Options in Visual Studio. 在Visual Studio中的Tegra-> Options下指定。 Where is Ant getting -source 1.5 from?
Ant从哪里获得-source 1.5?
I fixed this by using the advice suggested in this answer . 我通过使用此答案中建议的建议来解决此问题 。 I went to
Project->Properties->Configuration Properties->Ant Build->Command Line
and then added -Djava.source=7 -Djava.target=7
under Additional Options. 我去了
Project->Properties->Configuration Properties->Ant Build->Command Line
-Djava.source=7 -Djava.target=7
Project->Properties->Configuration Properties->Ant Build->Command Line
,然后在Additional Options下添加了-Djava.source=7 -Djava.target=7
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.