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.
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.
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.
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.
Check that you don't have an M2_HOME environment variable.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With