简体   繁体   English

执行Maven时找不到Java classes.jar'错误

[英]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.

相关问题 在模块 classes.jar 中发现重复的类 - Duplicated classes found in modules classes.jar Maven导入AAR Classes.jar - Maven Import AAR Classes.jar Maven 工件 *-classes.jar 两次部署到存储库 - attachClasses - Maven artifacts *-classes.jar deployed twice to repository - attachClasses maven:如何以独立于操作系统的方式加载 tools.jar/classes.jar? - maven: How to load tools.jar/classes.jar in an OS independent way? maven 2.2 war build不会将类放在关联的* -classes.jar文件中 - maven 2.2 war build does not put classes in associated *-classes.jar file Proguard混淆在使用Maven的Jenkins构建中失败-无法读取classes.jar - Proguard Obfuscation failed in Jenkins build using Maven - can't read classes.jar 执行从Maven构建的jar时出现“发生Java错误”消息 - “Java error occurred” message while executing a jar built from maven 执行 jar 时出现 Java ArrayIndexOutofBounds 错误 - Java ArrayIndexOutofBounds error when executing jar Proguard for Java混淆,从Windows迁移到Mac,找不到classes.jar - Proguard for java obfuscation, migrate from windows to mac, cannot find classes.jar 错误:任务 &#39;:app:packageRelease&#39; 的执行失败。 &gt; 无法计算 /../AndroidStudioProjects/../classes.jar 的哈希值 - Error:Execution failed for task ':app:packageRelease'. > Unable to compute hash of /../AndroidStudioProjects/../classes.jar
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM