6

I have installed a 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 command it shows it like this:

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

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

I Have Setted Path Also

Bacteria
  • 8,406
  • 10
  • 50
  • 67
Mani Mani
  • 107
  • 1
  • 1
  • 10

4 Answers4

10

You mentioned M2_HOME environment variable incorrectly.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.

Bacteria
  • 8,406
  • 10
  • 50
  • 67
0

There might be an export somewhere you are not aware of.

Check all places where environment variables are defined, e.g.

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

In my case .mavenrc was pointing to my old maven's home, I deleted it and everything worked as expected.

gsuntres
  • 71
  • 2
  • 5
0

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

After I ran : source /etc/environment

everything worked after that. It might help.

Zwakele Mgabhi
  • 377
  • 2
  • 8
0

In my case:

For some reason CLASSWORLDS_JAR system variable was empty.

This worked for me:

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

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114