在Windows 7上安装Maven时出错

问题描述:

因此,按照此处的说明http://www.mkyong.com/maven/how-to-install-maven-in-windows/我尝试在Windows 7环境中设置Maven。问题是,当我过我运行mvn --version或MVN为此事的任何命令我得到一个错误说:在Windows 7上安装Maven时出错

Error: Could not find or load main class org.codehaus.plexus.classwords.launcher.Launcher 

任何想法,什么可能导致这个问题以及如何解决它?

如果你看一看到doc你可以看到这一点:

Why do I get java.lang.NoClassDefFoundError: org/codehaus/classworlds/Launcher when I try to execute Maven?

This sometimes happens when $M2_HOME is not the same as your $PATH. That is, when 'which mvn' does not match $M2_HOME/bin/mvn.

+1

使用;%M2_HOME%\在路径的值bin,以避免此类错误的... – 2012-07-30 20:06:59