本文介绍了设置Maven时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在安装Maven时遇到了困难。
我根据这个设置了所有的环境变量:
虽然我使用的是Windows 7,当我尝试运行命令 mvn --version
时,我得到, mvn未被识别为内部或外部命令
等。
当我从 src \ bin
中运行它时,我收到错误:
异常在线程 主要 抛出java.lang.ClassNotFoundException:org.codehaus.plexus.classworlds.launcher.Launcher在java的
.net.URLClassLoader $ 1.run< URLClassLoader.java:202>
at java.security.AccessController.doPrivleged(Native Method)
... etc
然后:
找不到主类:org.codehaus.plexus.classworlds.launcher.Launcher。
解决方案
请确认你没有一个M2_HOME环境变量。
I am having difficulties installing Maven.
I have set all the enviromental variables according to this: http://maven.apache.org/download.html
Although I am using windows 7, when I try and run the command mvn --version
, I get, mvn is not recognized as an internal or external command
etc.
When I run it from within src\bin
, I get the error:
Exception in thread "main" java.lang.ClassNotFoundException: org.codehaus.plexus.classworlds.launcher.Launcher
at java.net.URLClassLoader$1.run<URLClassLoader.java:202>
at java.security.AccessController.doPrivleged(Native Method)
...etc
then:
Could not find the main class: org.codehaus.plexus.classworlds.launcher.Launcher.
解决方案
Check that you don't have an M2_HOME environment variable.
这篇关于设置Maven时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!