2

I need older version of m2e because I need to use older maven version (I have to compile some projects with JDK 1.6).

Here the exception when launch any build (with java 1.6) in Mars:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:401) at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42) at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:254) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239) at org.codehaus.plexus.classworlds.launcher.Launcher.getMainClass(Launcher.java:144) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:266) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) 

Same problem if install external maven component, because the problem should be the new m2e plugin, compiled with JDK 1.7.

Any suggestions?

Here a related problem.

Regards.

1

3 Answers 3

7

Download an version of Maven which support JDK 6 or hight, you can see in Maven Release History. I downloaded version 3.2.5.

After that open Eclipse Mars > Window > Preferences > Maven > Installations and add Maven 3.2.5, that click Apply then OK

Sign up to request clarification or add additional context in comments.

3 Comments

As described, using an oldest external maven component (compiled with 1.6) does not solve the problem because the plugin used by Mars is compiled with 1.7. Return to Luna is for now the only solution.
Well... I had the same problem with Mars and a maven project compiled with JDK 6. I did those steps and it work in my case
Ok, the problem seems to be resolved, by setting the correct maven runtime into specific "Run configuration" afterwards. Thank's arthurfnsc!
2

Go back to Luna. Seriously. =)

Do you really wanna try Mars? Ok, go on...

Firstly, download an eclipse version for non-java devs (for c/c++ devs should do the trick).

Secondly, install the "Eclipse Java Development Tools" package (select "Install New Software..." under the "Help" menu). Restart eclipse.

Now, open the same window again. Add the repository from m2e project (http://download.eclipse.org/technology/m2e/releases), uncheck "Show only the latest versions of available software" and check the higher 1.5.x version from m2e plugin (currently 1.5.2.20150414-2215). Restart eclipse again.

Enjoy (and good luck).

Comments

0

m2e plugin in version >= 1.6 does not support Maven 2. If you want to install m2e plugin 1.5.x in Eclipse Mars with m2e 1.6 already installed (see row "Maven Integration for Eclipse" at. https://eclipse.org/downloads/compare.php?release=mars) you should:

  1. download Eclipse Luna Package with "Maven Integration for Eclipse" installed;
  2. copy all jars and directories from

    ${eclipse_luna}\plugins 

    starting with org.eclipse.m2e prefix to

    ${eclipse_mars}\plugins; 
  3. in

    ${eclipse_mars}\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info 

    remove all lines starting with org.eclipse.m2e prefix and copy-paste all lines starting with org.eclipse.m2e from

    ${eclipse_luna}\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info 

Remember not to update "Maven Integration for Eclipse" feature, because it will probably overwrite above changes.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.