Hi, I am trying to migrate my Java project to Gradle. I previously compiled and built it with Eclipse. I have jdk7 and jdk8 installed, and my PATH and JAVA_HOME both point to my jdk8 installation.
When I attempt to build my application, I get syntax errors which seem as if Gradle is attempting to build the application with a Java version previous to 1.7. This is perfectly valid java 1.7+ syntax.
>gradlew.bat jar
...
.../classname.java:33: error: cannot infer type arguments for
HashSet<> Set<ZipEntry> entries = new HashSet<>(Collections.list(zipFile.entries()));
However, Gradle appears to have jdk 1.8 available.
>gradlew.bat -v
------------------------------------------------------------
Gradle 2.1
------------------------------------------------------------
Build time:
2014-09-08 10:40:39 UTC
Build number: none
Revision:
e6cf70745ac11fa943e19294d19a2c527a669a53
Groovy:
2.3.6
Ant:
Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:
1.8.0_20 (Oracle Corporation 25.20-b23)
OS:
Windows 8.1 6.3 amd64
I’m not sure what is wrong here. Can anyone help?