D:\IDEA_CODE\springboot-xuexi\cloud-eureka-client\target>java -jar cloud-eureka-clie
nt-0.0.1-SNAPSHOT.jar --server.port=10101
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/example/eurek
a/client/EurekaClientApplication : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(Launched
URLClassLoader.java:94)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:46)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
D:\IDEA_CODE\springboot-xuexi\cloud-eureka-client\target>
高版本JDK編譯的class不能在低版本的jvm虛擬機下運行
出現(xiàn)這個問題是本機的JDK環(huán)境變量配置錯了,我安裝了jdk1.7和1.8兩個版本谆棱,環(huán)境變量中配置的1.7牢裳, 而開發(fā)工具IDE中我配置的1.8拧略,所以用java -jar 啟動的時候報錯Unsupported major.minor version 52.0