简体   繁体   中英

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM