简体   繁体   中英

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. But all of these answers show you how to set the language level in Eclipse or NetBeans or 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.

I have CodeWorks for Android 1R4 installed which is the latest and the paths I have set up are to the following packages:

NDK R10e
JDK 1.7.0_71
Ant 1.8.2

which are specified under Tegra->Options in Visual Studio. Where is Ant getting -source 1.5 from?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM