What is “compiler compliance level” in Eclipse?

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.

Leave a Comment