How do I tell Gradle to use specific JDK version?

前端 未结 17 2463
时光取名叫无心
时光取名叫无心 2020-11-22 12:12

I can\'t figure out to get this working.

Scenario:

  • I have an application built with gradle
  • The application uses JavaFX

What I w

17条回答
  •  清歌不尽
    2020-11-22 12:22

    Two ways

    1. In gradle.properties in the .gradle directory in your HOME_DIRECTORY set org.gradle.java.home=/path_to_jdk_directory

    or:

    1. In your build.gradle

       compileJava.options.fork = true
       compileJava.options.forkOptions.executable = '/path_to_javac'
      

提交回复
热议问题