I am creating an app which uses cordova ionic and angular and for barcode scanning i am using native and able to integrate with the javascript code.If I run the project using eclipse IDE its working fine but if I do ionic run android - getting the above error - diamond operator is not supported in - source 1.5
For native i used this link https://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/ and its working fine.
Can anyone help on this issue?
Try to add apache plugnin to your Pom.xml under Build tag as @Sudarshan mentioned.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
This would resolve issue
You are using <>
which is not supported by the java source you are using since it got added only in Java 1.7
Find the places in your source code where you are using <>
and properly specify the generic that is implied.
e.g. if it was:
List<String> myList = new ArrayList<>();
rewrite it as
List<String> myList = new ArrayList<String>();
Note: Although diamond operator is a handy shortcut, I'd recommend to always specify full generics as it not only adds to readability, it also does not create a 1.7+ dependency on your source. (Which as we can see can sometimes lead to problems.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With