gpt4 book ai didi

ubuntu - 在 Ubuntu 12.04 上安装 Gradle

转载 作者:太空宇宙 更新时间:2023-11-03 16:46:32 24 4
gpt4 key购买 nike

我正在尝试在 Ubuntu 12.04 上安装 Gradle。起初我使用存储库中的包,但在点击 this 之后bug事实证明我最好使用更新的版本。

我已经删除了内置包并通过将官方 1.0 包复制到 /usr/local/share/ 目录并从 /usr/local 添加软链接(soft link)来安装 gradle/bin/gradle//usr/local/share/gradle-1.0/bin/gradle

它似乎可以工作,但我遇到了类路径问题。也就是说,一旦我尝试构建一个项目,我就会得到

Exception executing org.gradle.api.internal.tasks.compile.ApiGroovyCompiler@1ab95774 in compiler daemon: java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileGroovy'.
> org/apache/commons/cli/ParseException

现在 locate commons-cli.jar 给我

/usr/share/groovy/lib/commons-cli.jar
/usr/share/java/commons-cli.jar

显然这两个 JAR 不在类路径中。通常我会运行带有 -cp 选项的 Java 可执行文件,以将内容添加到类路径中。但是 gradle 可执行文件本身是一个脚本,它在调用 Java 之前自行设置类路径。

What is the correct way to install Gradle and make it find everything that needs on its classpath?

请注意,我是 JVM 世界的新手,所以不要以为我熟悉任何东西:-)

最佳答案

原来放够了

groovy group: 'commons-cli', name: 'commons-cli', version: '1.0'

依赖

关于ubuntu - 在 Ubuntu 12.04 上安装 Gradle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11527676/

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