0

I run ./gradlew clean build

and i get this error:

warning: [options] bootstrap class path not set in conjunction with -source 1.6

/Users/eladb/WorkspaceQa/java/UsersServer/src/test/java/linqmap/users/jms/UsersServerAccessPropUserNameTest.java:163: error: diamond operator is not supported in -source 1.6

        Map<String, String> properties = new HashMap<>();

                                                     ^

  (use -source 7 or higher to enable diamond operator)

1 error

1 warning

:compileTestJava FAILED



FAILURE: Build failed with an exception.



* What went wrong:

Execution failed for task ':compileTestJava'.

> Compilation failed; see the compiler error output for details.



BUILD FAILED

even though I see my java home is java 8.

where else do i need to configure java 8 ?

➜ myServer  echo $JAVA_HOME      

/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home

my gradle.build:

apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'jacoco'

sourceCompatibility = 1.8
version = '1.0'

repositories {
    mavenCentral()
    jcenter()
}

dependencies {
//
//    configurations.all*.exclude(group: 'com.sun.jersey', module: 'jersey-bundle')
//    configurations.all*.exclude(group: 'com.fasterxml.jackson.core', module:'jackson-databind')


    compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'

    compile 'com.google.inject:guice:4.0-beta5'
    compile 'com.sun.jersey:jersey-core:1.18.3'
    compile 'com.sun.jersey:jersey-client:1.18.3'
Cœur
  • 37,241
  • 25
  • 195
  • 267
Elad Benda
  • 35,076
  • 87
  • 265
  • 471
  • You've configured the compilation task to use the option `-source 1.6`. And you're using JDK8 to compile, and using syntax available since Java 7. That's why gradle complains. Post your build.gradle. – JB Nizet May 19 '15 at 17:01
  • added. and i have `sourceCompatibility = 1.8 ` – Elad Benda May 19 '15 at 17:25
  • The build fails for compileTestJava. Have you configured this task somehow? Do you also use the diamond operator in non-test source files? – JB Nizet May 19 '15 at 17:38
  • it all used to work till i updated my intellij – Elad Benda May 19 '15 at 17:44
  • What does that have to do with IntelliJ. Gradle doesn't care about your version of IntelliJ. – JB Nizet May 19 '15 at 17:46

1 Answers1

0

It looks like you've explicitly set the source compatibility.

Try adding:

sourceCompatibility = 1.8
objectuser
  • 671
  • 6
  • 15