Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/ma v

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/ma v相关的知识,希望对你有一定的参考价值。

安装maven 中出现例如以下异常:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/ma
ven/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:14
1)
        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(Cl
assRealm.java:401)
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(
SelfFirstStrategy.java:42)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadCl
ass(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(Launch
er.java:144)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:266)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
356)


出现如上异常 : 由于之前jdk的版本号是 1.6  maven 版本号是 3.3   由于maven 3.3 jdk必须是 jdk7 所以从重装jdk 就可以 


以上是关于Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/ma v的主要内容,如果未能解决你的问题,请参考以下文章

ERROR Utils: Uncaught exception in thread stdout writer for python

execjs执行js代码报错:Exception in thread Thread-1

Exception in thread "Thread-1" java.util.ConcurrentModificationException 异常原因和解决方法

Exception in thread "main" org.springframework.mail.MailSendException; nested exception de

Exception in thread “main“ java.lang.NoClassDefFoundError

已解决Exception in thread “Thread-0“ redis.clients.jedis.exceptions.JedisConnectionException: java.n(代码