Exception in thread "main" java.lang.unsupportedclassversionerror:org/apache/maven/cli/mavencli:unsupported Major.minor version 51.0at 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)
Explore the MAVEN version that Eclipse uses
Found with built-in version 3.3.9
View official website http://maven.apache.org/download.cgi
Find the minimum requirement for this version JDK 1.7
Continue viewing your project using the JRE version is 1.5
Survey results
When you build this project, you use 1.5, while running Maven 3.3.9 requires at least 1.7
Try adjusting the item to 1.6
It's still a mistake.
Until--
Adjust to 1.7, build successfully, confirm that this is the problem.
[INFO] BUILD SUCCESS
Solution Solutions
The first type:
Upgrade the project JRE version to 1.7 and above (available via Maven compiler Plugin)
The second type:
Reduce MAVEN version to 3.2 (no built-in version, use external version, e.g.)
P S
A little bit of knowledge about Window-preferences-java-compiler
This setting only affects the default JRE option when creating a new normal Java Project (you can use the default, or you can use the other)
Ultimately, the JRE that runs when the project is built is the JRE in the project Build Path (MAVEN project If you do not specify a plug-in, the default is JRE1.5)
org/apache/maven/cli/mavencli:unsupported Major.minor version 51.0