天道不一定酬所有勤
但是,天道只酬勤
Hollis出品的全套Java面试宝典不来了解一下吗?

Java unsupported major minor version 52.0

Hollis出品的全套Java面试宝典不来了解一下吗?

Here are the major version of every JRE released so far :

Java SE 8 = 52,
Java SE 7 = 51,
Java SE 6.0 = 50,
Java SE 5.0 = 49,
JDK 1.4 = 48,
JDK 1.3 = 47,
JDK 1.2 = 46,
JDK 1.1 = 45

You can see that Java 8 has major version 52

which means if you run javac command from Java 8 installation, it will by default generate a class with major version 52.

If you run this class file in JRE 7, you will get "Unsupported major.minor version 52.0".

Same is the case with an applet compiled in JDK 1.8, running in a browser with JRE 1.7

Read more: http://javarevisited.blogspot.com/2015/05/fixing-unsupported-majorminor-version.html#ixzz3uUfe4BbX

翻译一下就是:使用jdk8编译的class文件,使用jre1.7运行的时候就会报该异常。

赞(0)
如未加特殊说明,此网站文章均为原创,转载必须注明出处。HollisChuang's Blog » Java unsupported major minor version 52.0
Hollis出品的全套Java面试宝典不来了解一下吗?

评论 抢沙发

HollisChuang's Blog

联系我关于我