在使用 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