本文介绍了尝试在cmd中查看mvn版本时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试在cmd中输入"mvn -version"时,我总是收到此错误.
I keep getting this error when trying to enter "mvn -version in the cmd.
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/plexus/c
lassworlds/launcher/Launcher
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.classworlds.lau
ncher.Launcher
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.codehaus.plexus.classworlds.launcher.Launcher
.程序将会退出. 'cmd'无法识别为内部或外部命令,
. Program will exit. 'cmd' is not recognized as an internal or external command,
推荐答案
这通常是M2_HOME或M3_HOME配置错误的问题.我不确定,但我想不能同时设置两者.另外,执行一个哪个mvn"-显然,某些JVM安装会在usr/bin中安装一个mvn.
This is usually a problem with misconfiguring M2_HOME or M3_HOME. I'm not sure, but I think you can't have both set. Also, do a "which mvn" - apparently some JVM installs will install a mvn in usr/bin.
这篇关于尝试在cmd中查看mvn版本时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!