How do I tell Gradle to use specific JDK version?

前端 未结 17 2393
时光取名叫无心
时光取名叫无心 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:30

    To people ending up here when searching for the Gradle equivalent of the Maven property maven.compiler.source (or 1.8):

    In build.gradle you can achieve this with

    apply plugin: 'java'
    sourceCompatibility = 1.8
    targetCompatibility = 1.8
    

    See the Gradle documentation on this.

提交回复
热议问题