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

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

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

Please remove M2_HOME as environment variable, it is already set by
the mvn script. The only things you need to do is: add
apache-maven-3.x.x/bin to your path, set JAVA_HOME as environment
variable. So no need to add %JAVA_HOME%/bin to your path

Try to run mvn -v from /Library/Maven-3.3.3/bin/ folder first to
confirm the installation is correct. Try to run mvn with xtrace info
(tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_03.html) and verify
the commandline built up by Maven. I assume you get an unexpected
classpath argument value.

For absolute new people to maven, make sure you download the Binary archives from the Maven site, and not the Source archives.

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

For what its worth, I had the same error: the Could not find or load main class org.codehaus... thing, but without any other info (youll find many people with this error message – but usually accompanied by extra info such as class loading failures).

It turns out I had a corrupted install, perhaps a some files silently failed to unzip or something. A rm -rf of the maven directory and re-download and unzipped fixed it.

Related posts on java :

Leave a Reply

Your email address will not be published. Required fields are marked *