0

the m2eclipse plugin is latest the eclipse is the latest the JDK is jdk7 the eclipse uses embedded maven version 3.xxx

I am keep getting this error “Error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher”

enter image description here

Junchen Liu
  • 4,687
  • 10
  • 47
  • 57

2 Answers2

1

It seems that there are some problems running the embedded Maven.

Try installing a fresh Maven version, then click Preferences , Maven, Installationsand set the directory where you have installed Maven. enter image description here

taringamberini
  • 2,594
  • 18
  • 29
  • i can see its a maven2 from your example. does the latest eclipse support maven 3? reason I ask is because I did the same step as your answer but my local installation is mvn3. and the eclipse thrown a no embedded maven found error – Junchen Liu Apr 05 '14 at 19:09
  • The image is taken from the [Developing with Eclipse and Maven](http://books.sonatype.com/m2eclipse-book/reference/preferences.html#fig-preferences-maven-installations) and in our team the "m2e" plugin is used with external Maven 3.1.1, 3.2.1 installation. I've done a fresh installation of "Eclipse IDE for Java EE Developers Eclipse IDE for Java EE Developers" and "m2e" and pointing my external Maven without any problems. You'd better open an issue or ask to [m2eclipse - Support](https://www.eclipse.org/m2e/support/). – taringamberini Apr 06 '14 at 12:33
  • Have you seen [this answer](http://stackoverflow.com/questions/11118237/maven-error-could-not-find-or-load-main-class-org-codehaus-plexus-classworlds-l) and [this other answer](http://stackoverflow.com/questions/20449836/error-could-not-find-or-load-main-class-org-codehaus-classworlds-launcher-while)? – taringamberini Apr 06 '14 at 12:37
  • @taringamerini thanks but both question wasn't answered – Junchen Liu Apr 06 '14 at 20:37
  • thanks for your help my friend. +1 for being so helpful – Junchen Liu Apr 06 '14 at 21:38
  • @shanyangqu Thank you for sharing your solution. I've appreciated your +1 too because I do the same thing with others: when some answers don't solve my problem but help me to find a solution a give +1 to all of them. This community stands on users feedback. – taringamberini Apr 07 '14 at 07:19
1

my envirement
eclipse version : 4.3 kepler
maven version : 3.2.x
OS : windows 7
m2e plugin version : 1.5

the problem caused by combination of things, e.g mismatch between maven installation and setting.xml is one, but mainly the problem was:

  • solution for my problem was to run the eclipse in administrator mode.

  • you can run maven embedded (comes with eclipse) or external installation
    just to make sure they are pointing to the right setting.xml file

  • somehow the embedded disappears sometimes, just restart eclipse it will appear again

  • finally I can confirm the latest m2e 1.5 or above supports maven 3.

    Note:

  • set JAVA_HOME is a must, because maven uses it to look up java which runs maven itself
  • set non-embeded maven installation location in the windows path is needed
  • set M2_HOME was NOT needed in my case, thus to get m2e working in eclipse or interact maven though command line, M2_HOME is not needed
  • Junchen Liu
    • 4,687
    • 10
    • 47
    • 57