如何在我的 Linux 机器上安装旧版本的 groovy - groovy 1.8.6?

如何在我的 Linux 机器上安装旧版本的 groovy - groovy 1.8.6?

我的 Linux 机器有操作系统:Ubuntu 18.04.3 LTS 目前它有 Groovy 版本:

build@###: $  groovy -version
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/usr/share/groovy/lib/groovy-2.4.16.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Groovy Version: 2.4.16 JVM: 11.0.5 Vendor: Private Build OS: Linux

我想降级到 1.8.6

请指导

答案1

我在默认的 apt 存储库中没有找到 groovy 1.8.6。除非你找到支持它的存储库,否则你应该手动操作。问题是 1.8.6 太旧了,我甚至在 a 处都没有找到文件Pache Groovy 网站. 一些罐子可用这里例如你可以下载groovy-all jar。这样,您应该能够运行任何已编译的类,并将其添加到您的类路径中。将 JAVA_HOME 设置为某个适当的 Java 版本,我想我会尝试 Java 6 或 7。否则,如果您有源代码,请使用较新版本的 groovy 重新编译它们。这可能需要对代码进行一些修复。

答案2

以下是二进制文件的链接:https://bintray.com/version/files/groovy/maven/groovy/1.8.6

更新 1

如何安装:

$ unzip groovy-binary-1.8.6.zip
$ sudo mv ./groovy-1.8.6 /usr/share/groovy-1.8.6
$ sudo update-alternatives --install "/usr/bin/groovy" "groovy" "/usr/share/groovy-1.8.6/bin/groovy" 186

相关内容