gpt4 book ai didi

Gradle:更改jdk

转载 作者:行者123 更新时间:2023-12-03 03:11:41 25 4
gpt4 key购买 nike

我已经配置 ~/.gradle/gradle.properties作为:

org.gradle.java.home=/home/jeusdi/java/jdk-11.0.2/

尽管如此,当我执行 gradle -version :
Initialized native services in: /home/jeusdi/.gradle/native

------------------------------------------------------------
Gradle 5.3
------------------------------------------------------------

Build time: 2019-03-20 11:03:29 UTC
Revision: f5c64796748a98efdbf6f99f44b6afe08492c2a0

Kotlin: 1.3.21
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM: 1.8.0_201 (Oracle Corporation 25.201-b09)
OS: Linux 4.18.0-16-generic amd64

如您所见,它选择了 1.8 JVM,而不是我在 gradle.properties 上设置的 java11。 .

有任何想法吗?

最佳答案

这些似乎是不同的设置。不确定,但可能 org.gradle.java.home gradle 将使用它来构建项目,而 JAVA_HOME运行gradle本身 - 你能验证一下吗?也请看看here :

org.gradle.java.home=(path to JDK home) Specifies the Java home for the Gradle build process. The value can be set to either a jdk or jre location, however, depending on what your build does, using a JDK is safer. A reasonable default is derived from your environment (JAVA_HOME or the path to java) if the setting is unspecified. This does not affect the version of Java used to launch the Gradle client VM

关于Gradle:更改jdk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55295354/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com