首页 > 系统服务 > 详细

eclipse中的 Compiler compliance level含义

时间:2016-12-28 20:47:41      阅读:435      评论:0      收藏:0      [点我收藏+]

The compiler compliance setting tells the compiler to pretend it‘s a different version of Java.

The Java 8 compiler will produce class files in the Java 8 version of the class file format, and accept Java 8 source files. JRE 6 can‘t load this version, because it was created after JRE 6 was.

If you set the compliance level to "JRE 6", it will instead compile Java 6 source files into Java 6 class files.

It‘s like saving a Word document as "Word 97-2003 format" - so that Word 97-2003 can read your document. You‘re saving the class files in Java 6 format so that Java 6 can read them.

 

我的理解就是 虽然eclipse使用的是jdk 8,但是通过设置 complier compliance setting 我们可以在jdk 6 (或其他) 环境中进行编译。 好比在word2010中将word文件保存为word2003的格式。

eclipse中的 Compiler compliance level含义

原文:http://www.cnblogs.com/zh1164/p/6230298.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!