Reputation: 13459
I am trying to compile my android project using the following command line:
cocos deploy -p android -m release But i keep getting some errors saying the following:
error: diamond operator is not supported in -source 1.5
I tried manually modifying the individual files to fix the declaration so that it doesnt depend on 1.7, but after i did it many many errors appeared (the diamond operator one got fixed thought). So what i am thinking is that i need to make cocos compile it directly with 1.7 instead.
But i have looked for it everywhere and i can't find where to change that.
I am not using eclipse, nor android studio, i am using the terminal directly with the cocos commands.
Does anyone have any idea about where this is changed?
Update:
It has something to do with the java compiler, but still can't find where to change the javac settings:
[javac] /Users/LuisOscar/Documents/CocosProjects/Zombies/proj.android/src/net/nend/NendModule/NendIconModule.java:56: error: diamond operator is not supported in -source 1.5
[javac] private static HashMap<String, NendAdIconData> mNendAdIconHashMap = new HashMap<>();
[javac] ^
[javac] (use -source 7 or higher to enable diamond operator)
[javac] /Users/LuisOscar/Documents/CocosProjects/Zombies/proj.android/src/net/nend/NendModule/NendModule.java:51: error: diamond operator is not supported in -source 1.5
[javac] private static HashMap<String, NendAdViewData> mNendAdHashMap = new HashMap<>();
[javac] ^
[javac] (use -source 7 or higher to enable diamond operator)
Upvotes: 1
Views: 794
Reputation: 13459
I found the location, For anyone else interested this is adjusted at:
Android/android-sdk-macosx/tools/ant/build.xml
It's shown under compilation options:
<property name="java.target" value="1.7" />
<property name="java.source" value="1.7" />
Upvotes: 1