我是新手,我开始使用安装Gradle指南.
当我按照指南的’环境变量’步骤,我将GRADLE_HOME设置为/ path / to / gradle并将/ path / to / gradle / bin添加到〜/ .bashrc中的PATH.
我在命令行中运行gradle -v,它给了我这个错误:
Exception in thread "main" java.lang.NoClassDefFoundError: org/gradle/launcher/GradleMain
Caused by: java.lang.ClassNotFoundException: org.gradle.launcher.GradleMain
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.gradle.launcher.GradleMain. Program will exit.
它看起来像类路径丢失所以我将CLASSPATH变量设置为’.:path / to / gradle / lib / gradle-launcher-1.2.jar’并再次登录.它还没有工作……
任何提示
Thx in Advance 原文链接:https://www.f2er.com/java/438225.html