perak
perak

Reputation: 1340

Gradle build with Java 8

I'm trying to build Java 8 project with Gradle 1.6, but I'm stuck on this error:

Execution failed for task ':ejb:compileJava'
invalid target release: 1.8

JAVA_HOME is set as "D:\Program Files\Java\jdk1.8.0", and build.gradle contains these lines:

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

Upvotes: 18

Views: 33972

Answers (2)

Jagdeep
Jagdeep

Reputation: 21

I found picking wrong JAVA_HOME path value. After updating correct path, it's working for me. No need to do any change.

Upvotes: 0

perak
perak

Reputation: 1340

Found the answer. I replaced JAVA_HOME

D:\Program Files\Java\jdk1.8.0

with

D:\Progra~2\Java\jdk1.8.0

and build succeeded.

Upvotes: 5

Related Questions