-
Notifications
You must be signed in to change notification settings - Fork 48
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
Broken on Java 16 #548
Comments
To also confirm, this worked on jdk 15:
|
This is due to JEP 396: Strongly Encapsulate JDK Internals by Default |
That JEP dangles some tantalising options:
https://openjdk.java.net/jeps/261#Packaging:-Modular-JAR-files - could this be as easy as just embedding a module-info.class file that specifies all the crazy --add-opens things this project needs? palantir-java-format/build.gradle Line 85 in 409f42e
EDIT seems like I confused |
Some relevant context from how google-java-format is tackling this: issue, readme. Basically their solution for running with Java16+ is that you have to run the formatter with |
The latest version should work with Java 16+. However depending on how you invoke the formatter you need to add When running the formatter through Gradle, you can for example add the args to your org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED The intellij plugin and integration with palantir/goethe will automatically add these flags for you. Closing this issue for now. Please re-open if you run into further issues! |
Note that I couldn't get goethe to add the flags in modern gradle (filed here: palantir/goethe#91) |
Using JDK 16:
Running task
generateMetrics
fails with:Bumping down to JDK 11 seems to fix the issue.
Errorprone had a similar issue and linked to their install docs: https://errorprone.info/docs/installation#jdk-16
The text was updated successfully, but these errors were encountered: