[英]Java classes.jar' could not be found error when executing maven
I just installed java 8 and maven on Mac El Captain. 我刚刚在Mac El Captain上安装了Java 8和Maven。 I have set all the environment variables correctly and java -version does display the java version. 我已经正确设置了所有环境变量,并且java -version确实显示了Java版本。 But when I try to run maven from the terminal I get the following error: 但是,当我尝试从终端运行Maven时,出现以下错误:
File or url '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes/classes.jar' could not be found
java.net.MalformedURLException: no protocol: /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes/classes.jar
at java.net.URL.<init>(URL.java:593)
at java.net.URL.<init>(URL.java:490)
at java.net.URL.<init>(URL.java:439)
at com.werken.forehead.Forehead.loadFileOrUrl(Forehead.java:403)
at com.werken.forehead.Forehead.load(Forehead.java:322)
at com.werken.forehead.Forehead.config(Forehead.java:245)
at com.werken.forehead.Forehead.config(Forehead.java:131)
at com.werken.forehead.Forehead.main(Forehead.java:579)
any ideas? 有任何想法吗?
For Maven 1.x, I found the following bit of the bin/maven
shell script caused the same error for me on a Mac: 对于Maven 1.x,我发现bin/maven
Shell脚本的以下位对Mac造成了相同的错误:
if $darwin; then
TOOLS_JAR="/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Classes/classes.jar"
fi
I simply edited the bin/maven
script file and commented out the if $darwin; then ... fi
我只是编辑bin/maven
脚本文件并注释掉if $darwin; then ... fi
if $darwin; then ... fi
section and it is now working. if $darwin; then ... fi
部分,它现在正在工作。
The pass where classes 通过哪里上课
java.net.MalformedURLException: no protocol: /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes/classes.jar
I would guess its 'JavaVM.framework' or really amissing protocol like 'file:' 我猜想它的'JavaVM.framework'或像'file:'那样真正缺失的协议
If you installed the JDK in a path like JavaVM.framework, try to installit in another path without '.' 如果您将JDK安装在JavaVM.framework之类的路径中,请尝试将其安装在不带'。'的其他路径中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.