Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java Bytecode version error with JDK 8 #58

Closed
vincenzopalazzo opened this issue Mar 27, 2021 · 6 comments
Closed

Java Bytecode version error with JDK 8 #58

vincenzopalazzo opened this issue Mar 27, 2021 · 6 comments

Comments

@vincenzopalazzo
Copy link

Hello, thank you to maintain this plugin.

I see an error with JDK 8, and I will report it below

Execution failed for task ':verifyGoogleJavaFormat'.
> com/google/googlejavaformat/java/JavaFormatterOptions$Style 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

With JDK 14 works well.

@jimshowalter
Copy link

jimshowalter commented Apr 13, 2021

The later versions don't support Java 8, which is a problem because the Java 8 version isn't compatible with Gradle 7: #59

@sherter
Copy link
Owner

sherter commented May 2, 2021

There is nothing I can do about this, the class in question is compiled by the https://github.com/google/google-java-format/ project.

@sherter sherter closed this as completed May 2, 2021
@sherter
Copy link
Owner

sherter commented May 2, 2021

But you could try to downgrade to an older version of google-java-format (by setting the toolVersion).

@jimshowalter
Copy link

Um, no, can't. Because the older version uses a feature that's deprecated in Gradle 7.x.

It appears we are at an impasse. The team that writes Google Java Format saw fit to upgrade it to Java 11 before getting rid of the Gradle deprecations, which forces all of us on Java 8 to either never upgrade Gradle, or stop using GJF.

@sherter
Copy link
Owner

sherter commented May 3, 2021

@jimshowalter It seems you have yet to understand what this gradle plugin does and how it relates to google-java-format. Please carefully read my comments and the documentation again (or rather first). google-java-format doesn't use Gradle at all.

@jimshowalter
Copy link

If you follow the instructions in the readme in https://github.com/jimshowalter/gjf-problem, you'll reproduce the problem we're seeing. If you can figure out what combination of configuration will make Java 8 work with the formatter and with Gradle 7.x, that would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants