Gigi
Gigi

Reputation: 31

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

Same to this one but still didn't figure out. tried all solution....

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

OS: Windows 7 Installed Maven 3.3.3 from ftp://mirror.reverse.net/pub/apache/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.zip

Environment variable:

Path = C:\Tools\apache-maven-3.3.3\bin

M2_HOME = C:\Tools\apache-maven-3.3.3

Error:

$ mvn

Error: Could not find or load main class org.codehaus.plexus.classworlds.launche r.Launcher

Upvotes: 3

Views: 18243

Answers (7)

Jose Mhlanga
Jose Mhlanga

Reputation: 855

Remove & disable the M2_HOME in the /etc/environment using the unset function as in

unset M2_HOME

Upvotes: 0

Sivakumarj
Sivakumarj

Reputation: 115

This means maven is not properly configured.

There is a chance that you might have downloaded wrong zip file or incomplete file.

Once you are sure the file is correct and unzipped, in windows, go to command prompt,go to bin,and try to execute the mvn.bat file. The error originates from that file.If it is executing nothing to worry.

Avoid setting MAVEN_HOME.Its not needed. Set the maven bin only in the PATH

Upvotes: 0

swati chiniwal
swati chiniwal

Reputation: 119

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

Upvotes: 5

Vishnu Prasad
Vishnu Prasad

Reputation: 11

Step1: Install ApacheMaven Binary-tar.gz archive file Step2: Add C:\Program Files\apache-maven-3.5.2\bin to the PATH under user variables Step3: In command prompt, run mvn -v

Upvotes: 1

felbus
felbus

Reputation: 2679

This fixed mine, taken from

use M3 home

I had this little issue on my Mac after installing maven3 and jdk1.7. Here is what fixed my issue:

  1. Remove the M2_HOME variable from the path.

  2. Add M3_HOME variable with the path to your maven 3 installation.

Here is the interesting part: I use symbolic links for versioning. The values of both M2_HOME and M3_HOME were identical. Both were /Developer/maven. Hence it appears that the name M2_HOME in place of M3_HOME is what actually causes the issue. I leave it as an exercise (that I may return to) to find the issue in the source.

Upvotes: 0

user3437517
user3437517

Reputation: 21

I've solved the error by downloading the bin file from maven, not the src file, and then the path pointing to the bin directory

Upvotes: 2

redaLyazidi
redaLyazidi

Reputation: 33

Change M2_HOME by MAVEN_HOME. It worked for me on Windows 7.

Upvotes: 0

Related Questions