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.ne开发者_C百科t.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
. Program will exit. 'cmd' is not recognized as an internal or external command,
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.
your maven configure is the problem.
once check your system variables path, MAVEN_HOME AND JAVA_HOME.
IN PATH - %MVN_HOME%/bin and that maven bin path also add in that path.
IN MAVEN_HOME - where your placing the Maven folder that path you add only not bin or lib folders.
IN JAVA_HOME - where you are installed java software that path can place in that directory. This is also not lib or bin folders just only JDK path.
In classpath- you can add just normally lib folder of the maven.
If you are not added the java_home your adding only maven_home that is also some will be raised.
Here i am placing some site url see that one solve your problem.
http://horrikhalid.wordpress.com/2011/01/12/a-simple-tutorial-of-jsf-2-0-eclipse-weld-and-maven-2/
N.S.Reddy
精彩评论