revelc/formatter-maven-plugin

2.17.0 version incompatibility with Java 8

Closed this issue · 1 comments

After upgrading formatter plugin version from 2.16.0 to 2.17.0 getting following error:
Error: Failed to execute goal net.revelc.code.formatter:formatter-maven-plugin:2.17.0:format (default) on project spring-xsuaa: Execution default of goal net.revelc.code.formatter:formatter-maven-plugin:2.17.0:format failed: An API incompatibility was encountered while executing net.revelc.code.formatter:formatter-maven-plugin:2.17.0:format: java.lang.UnsupportedClassVersionError: org/eclipse/jdt/core/ToolFactory has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I have defined the compiler versions in my POMs and also in eclipse_settings.xml to 1.8
Doesn't the latest formatter version any longer support Java 8:question:

Versions (OS, Maven, Java, and others, as appropriate):

  • Affected version(s) of this project: 2.17.0
  • OS: mac os x
  • Maven: 3.8.3
  • Java version: 1.8.0_261

To Reproduce

  1. upgrade plugin version
  2. execute mvn goal formatter:format

Expected behavior
format the project

Doesn't the latest formatter version any longer support Java 8

Unfortunately, no, it doesn't. The upstream Eclipse JDT jars were built with class version 55 (Java 11), so our minimum supported version for 2.17.0 has to be Java 11. 2.16.0 should still work with Java 8, but as far as I know, we don't plan on adding new features to that version. This was enforced more strictly in #533 for 2.17.1 (which we are working on releasing soon). Unfortunately, it won't change the user experience, though... users will still see class version failures trying to use 2.17.1 or newer with Java 10 or earlier. But, hopefully, the error will be more instantaneous and obvious.