Maven error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher

I hit this problem too, and found this article. For Maven3, changing my environment variable name from M2_HOME to M3_HOME did the trick. I am on a Mac running OSX 10.9 with JDK 1.7. Hope this helps.

Note: Please delete M2_HOME, if already set. Eg: unset M2_HOME


Even though the question is answered I would like to add that, if you are getting the above mentioned error, be sure that you have downloaded the Binary file.

The source file should only be downloaded if you are an advanced user and that you know how to deal with it.

I have had quite a share of people downloading the wrong file, seniors and juniors


I was having this same problem and was able to resolve it by carefully redoing the Environment Variables:

  • M2_HOME
  • M2
  • JAVA_HOME

Also, I made them all System Variables, not User Variables like the Maven instructions say. When you

echo %Path%

Make sure you can see the %M2% and %JAVA_HOME% variables completely expanded, i.e. :

C:\Users\afairchild>echo %Path%
C:\Program Files\Apache Software Foundation\apache-maven-3.0.4\bin;C:\Program Files\Java\jdk1.7.0_09\bin; [etc]

Had this issue on two different Ubuntu 12.04 installs, despite the installs being done by apt-get. Issue was M2_HOME.

Fixed with:

export M2_HOME=/usr/share/maven

I believe this error caused because of downloading SRC instead of BINARY from Maven site. Please make sure to download Binary zip.

Because the below path, you will get only when you download SRC:

M2_HOME C:\apache-maven-3.0.4\apache-maven\src

enter image description here