gpt4 book ai didi

java - sdkman gradle 3.4无法确定java版本

转载 作者:行者123 更新时间:2023-11-30 01:42:40 24 4
gpt4 key购买 nike

在使用 gradle 5.6.1 的终端中工作时,许多事情都会按预期进行。例如。更改为较旧的 java 版本 (1)。如果我更改为 gradle 3.4 gradle 不再找到 jdk (1)。

如何让 gradle 3.4 再次在我的系统上运行。

我想构建一个我曾经用 gradle 3.4 制作的项目。但是,我没有 gradle 包装器,并且由于 gradle 5.6.1 的更改,构建似乎已损坏。

(1)

user@system:~$ sdk u gradle 3.4                                                                      

Using gradle version 3.4 in this shell.
user@system:~$ gradle -v

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '11.0.5'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
user@system:~$ sdk u java 9.0.4

Stop! java 9.0.4 is not available. Possible causes:
* 9.0.4 is an invalid version
* java binaries are incompatible with Linux64
* java has not been released yet
user@system:~$ sdk u java 9.0.4-open

Using java version 9.0.4-open in this shell.
user@system:~$ gradle

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '9.0.4'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

(2)

user@system:~$ gradle -v                                                                                         
------------------------------------------------------------
Gradle 5.6.1
------------------------------------------------------------

Build time: 2019-08-28 02:49:34 UTC
Revision: b6bd8e7934ca41d9e52610058aa7cb834df81fc4

Kotlin: 1.3.41
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM: 11.0.5 (Debian 11.0.5+10-post-Debian-1deb10u1)
OS: Linux 4.19.0-6-amd64 amd64

user@system:~$ sdk u java 9.0.4-open

Using java version 9.0.4-open in this shell.
user@system:~$ gradle -v
------------------------------------------------------------
Gradle 5.6.1
------------------------------------------------------------

Build time: 2019-08-28 02:49:34 UTC
Revision: b6bd8e7934ca41d9e52610058aa7cb834df81fc4

Kotlin: 1.3.41
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM: 9.0.4 (Oracle Corporation 9.0.4+11)
OS: Linux 4.19.0-6-amd64 amd64

最佳答案

Gradle 仅支持 Java 11(和 10)Gradle version 4.7 ,另见https://github.com/gradle/gradle/issues/4591 。自 Gradle 4.1 起支持 Java 9 。因此,您最好的选择是尝试 Gradle 4.7 是否可以开箱即用,或者使您的构建与当前 Gradle 版本兼容。

关于java - sdkman gradle 3.4无法确定java版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59423731/

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