Reputation: 1310
I just installed java 8 and maven on Mac El Captain. I have set all the environment variables correctly and java -version does display the java version. But when I try to run maven from the terminal I get the following error:
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?
Upvotes: 0
Views: 643
Reputation: 1225
For Maven 1.x, I found the following bit of the bin/maven
shell script caused the same error for me on a 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
section and it is now working.
Upvotes: 1
Reputation: 9526
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:'
If you installed the JDK in a path like JavaVM.framework, try to installit in another path without '.'
Upvotes: 0