Maven throws a ClassNotFoundException codehaus.plexus.Launcher with JDK 9 [closed]

亡梦爱人 提交于 2019-12-24 01:37:23

问题


While trying the freshly released JDK 9, I noticed that it seems to break maven entirely. Even a simple mvn -version won't work:

vgm@localhost:~$ mvn -version
Error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.classworlds.launcher.Launcher

When I switch back to openjdk8, it says the maven version is 3.3.9.

I've tried setting JAVA_HOME and MVN_OPTS, but it had no effect. These are my settings:

vgm@localhost:~$ echo $JAVA_HOME 
/usr/java/jdk-9
vgm@localhost:~$ echo $MVN_OPTS
-Dmaven.compiler.fork -Dmaven.compiler.executable=/usr/bin/javac

回答1:


As nullpointer suggested, I updated to Maven 3.5.0, and it works now.



来源:https://stackoverflow.com/questions/46500516/maven-throws-a-classnotfoundexception-codehaus-plexus-launcher-with-jdk-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!