简体   繁体   English

Visual Studio 2012 + Ant:-source 1.5中不支持Diamond运算符

[英]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或NetBeansAndroid 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.

相关问题 -source 1.5 不支持菱形运算符 - diamond operator is not supported in -source 1.5 Apache Maven:-source 1.5中不支持Diamond运算符 - Apache Maven: Diamond operator is not supported in -source 1.5 错误:-source1.5不支持菱形运算符 - error: diamond operator is not supported in -source1.5 为什么我得到错误 diamond operator is not supported in -source 1.5 in Java? - Why i get error diamond operator is not supported in -source 1.5 in Java? NetBeans:-source 1.5不支持菱形运算符(使用-source 7或更高版本启用菱形运算符) - NetBeans : diamond operator is not supported in -source 1.5 (use -source 7 or higher to enable diamond operator) Ant使用-source 7或更高版本来启用钻石操作员 - Ant use -source 7 or higher to enable diamond operator 通过Maven错误进行议程代码编译:AgendaSample1Impl.java:[47,81]错误:-source 1.5中不支持Diamond运算符 - Agenda code compilation via maven error: AgendaSample1Impl.java:[47,81] error: diamond operator is not supported in -source 1.5 错误:(24,46)错误:-source 1.6不支持Diamond运算符(使用-source 7或更高版本来启用Diamond运算符) - Error:(24, 46) error: diamond operator is not supported in -source 1.6 (use -source 7 or higher to enable diamond operator) 源1.6不支持Java Combo Box Diamond运算符 - Java Combo Box Diamond Operator not supported in source 1.6 Azure DevOps Pipeline 上的错误“-source 6 中不支持菱形运算符” - Error on Azure DevOps Pipeline "diamond operator is not supported in -source 6"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM