Maven throws a ClassNotFoundException codehaus.ple

2019-07-09 20:29发布

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条回答
女痞
2楼-- · 2019-07-09 20:40

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

查看更多
登录 后发表回答