Error: could not find or load the main class org.codehaus.plexus.classworlds.launcher.Launcher

I installed the latest maven-3.2.5 on Linux Mint Throgh CLi. The installation details are as follows:

 export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/ export M2_HOME=/home/mani/apache-maven-3.2.5/bin/ 

In the team, he shows it as follows:

 mani@manithullimilli ~/apache-maven-3.2.5/bin $ ./mvn version 

Error: could not find or load the main class org.codehaus.plexus.classworlds.launcher.Launcher mani @manithullimilli ~ / apache-maven-3.2.5 / bin $

I set the path also

+6
source share
4 answers

You specified an invalid M2_HOME environment variable. The M2_HOME environment variable should be " /home/mani/apache-maven-3.2.5 "

 export M2_HOME=/home/mani/apache-maven-3.2.5 

and add the $ M2_HOME / bin directory to your path.

+10
source

There may be an export that you are not aware of.

Check all places where environment variables are defined, for example

  /etc/environment ~/.bashrc ~/.mavenrc 

In my case .mavenrc pointing to my old maven house, I deleted it and everything worked as expected (my new installation approved it instead of .bashrc).

0
source

I had the same problem, I installed maven, everything was correct, but still got the error "could not find class".

After launch: source / etc / environment

after that everything worked. This can help.

0
source

In my case:

For some reason, the CLASSWORLDS_JAR system variable was empty.

This worked for me:

Defined this system variable with the value %MAVEN_HOME%\boot\plexus-classworlds-2.5.2 ,

0
source

Source: https://habr.com/ru/post/988292/


All Articles