当我跑...
grails package
java -jar build/libs/<my_app>.jar
我明白了......
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/company/my_app/Application : 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 org.springframework.boot.loader.LaunchedURLClassLoader.doLoadClass(LaunchedURLClassLoader.java:170)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:142)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:47)
at java.lang.Thread.run(Thread.java:745)
答案 0 :(得分:0)
结果很简单。我使用的是Java 7.当我升级到Java 8时,一切正常。