How to specify jdk version in gradle?

已回答

What steps will reproduce the issue?

  1. download https://www.dropbox.com/s/oncl0sonm4dsagb/demo.tar.gz?dl=0
  2. untar demo project
  3. import it in idea
  4. setting "Project Structure", select "Project SDK", use "JDK8"
  5. reimport

What is the expected result?
"JDK8" selected "Project SDK" in "Project structure"

What happens instead?
"JDK11" (or jdk latest version installed)

 

if i m using maven in idea. just setting up "maven-compiler-plugin". and idea will using the plugin using jdk version. but, gradle, how to do it?

0

Looks like an issue with the Gradle Kotlin build files. Please vote anf follow this issue for progress: https://youtrack.jetbrains.com/issue/KT-36130

Note that the target JVM verison is still set correctly to 1.8 in Project Structure | Modules | Sources | Language level and Settings (Preferences on macOS) | Build, Execution, Deployment | Compiler | Java Compiler.

Try to set the 1.8 JDK in Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Gradle | Gradle JVM.

1

请先登录再写评论。