Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems setting up Maven [duplicate]

Tags:

I am having difficulties installing Maven.

I have set all the enviromental variables according to this: http://maven.apache.org/download.html

Although I am using windows 7, when I try and run the command mvn --version, I get, mvn is not recognized as an internal or external command etc.

When I run it from within src\bin, I get the error:

Exception in thread "main" java.lang.ClassNotFoundException: org.codehaus.plexus.classworlds.launcher.Launcher  at java.net.URLClassLoader$1.run<URLClassLoader.java:202> at java.security.AccessController.doPrivleged(Native Method)  ...etc 

then:

Could not find the main class: org.codehaus.plexus.classworlds.launcher.Launcher. 
like image 412
JWK Avatar asked Jun 10 '11 11:06

JWK


People also ask

How do I remove duplicate dependency?

Removing Duplicate Dependencies Once we have identified our duplicate dependencies, the simplest way to remove them is to delete them from pom. xml and keep only those unique dependencies that are used by our project.

How do you resolve problems in POM xml?

You can usually resolve these errors by updating Maven dependencies as follows: Right-click on your top-level project (not on the pom. xml file) in the Project Explorer view. From the menu, choose Maven > Update project.

How do I delete duplicate dependencies in Maven?

Use the <exclusions> tag into <dependency> tag of the pom to exclude that duplicate dependencies from maven project. Show activity on this post. Run mvn clean It will tell you your duplicate dependencies. Then delete them.


2 Answers

Check that you don't have an M2_HOME environment variable.

like image 147
andhdo Avatar answered Oct 13 '22 17:10

andhdo


I ended up on this question with the same problem, however, I had committed an elementary mistake of downloading the apache-maven-..*-src.zip instead of the apache-maven-..*-bin.zip

Once I realised that mistake, it was smooth sailing as soon as I corrected it. I suppose the instructions on the download page should be more than adequate

like image 31
shekhar karande Avatar answered Oct 13 '22 19:10

shekhar karande