has been compiled by a more recent version of the Java Runtime (class file version 61.0),

Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationListener : org.springframework.cloud.bootstrap.BootstrapApplicationListener
	at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:439)
	at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:421)
	at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:414)
	at org.springframework.boot.SpringApplication.(SpringApplication.java:270)
	at org.springframework.boot.SpringApplication.(SpringApplication.java:250)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204)
	at com.atguigu.gulimall.order.GulimallOrderApplication.main(GulimallOrderApplication.java:10)
Caused by: java.lang.UnsupportedClassVersionError: org/springframework/cloud/bootstrap/BootstrapApplicationListener has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:275)
	at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:432)
	... 7 more

应该是被较高版本的jdk版本编译了,然后运行的时候用的jdk版本和编译时的版本不一致就会这样。如果下面这两个结果不一样就是版本不一致。

javac -version
java -version

解决方案

先把版本不一致的问题解决了,再按下面的基本没问题了

this version of the Java Runtime only recognizes class file versions up to 52.0-CSDN博客

你可能感兴趣的:(bug解决,java,开发语言)