Java 16+ support
See original GitHub issueWhat steps will reproduce the problem? Steps to reproduce the behavior:
- Use openjdk 16
- Run
mvn git-code-format:format-code
- Watch it fail
What is the expected output? Success
What happens instead?
[INFO] --- git-code-format-maven-plugin:3.0:format-code (default-cli) @ projectname ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.394 s
[INFO] Finished at: 2021-07-02T13:19:12+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.cosium.code:git-code-format-maven-plugin:3.0:format-code (default-cli) on project projectname: Execution default-cli of goal com.cosium.code:git-code-format-maven-plugin:3.0:format-code failed: An API incompatibility was encountered while executing com.cosium.code:git-code-format-maven-plugin:3.0:format-code: java.lang.IllegalAccessError: class com.google.googlejavaformat.java.JavaInput (in unnamed module @0x73d3e555) cannot access class com.sun.tools.javac.parser.Tokens$TokenKind (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.parser to unnamed module @0x73d3e555
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>com.cosium.code:git-code-format-maven-plugin:3.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
Environment:
- OS: Arch Linux
- Git version: 2.32.0
- git-code-format-maven-plugin version: 3.0
- Maven version: 3.8.1
- Java version: 16.0.1
Additional context https://github.com/google/google-java-format/issues/538 https://github.com/google/google-java-format/issues/612
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Oracle Java SE Support Roadmap
Oracle provides this Oracle Java SE Support Roadmap, to help you understand maintenance and support options and related timelines.
Read more >Java/OpenJDK - endoflife.date
Release Released Active Support
19 2 months and 4 weeks ago. (20 Sep 2022) Ends in 3 months. (21 Mar 2023)
18 9 months ago....
Read more >Java version history - Wikipedia
Regarding Oracle Java SE Support Roadmap, version 19 is the latest one, and versions 17, 11 and 8 are the currently supported long-term...
Read more >Eclipse with Java 16 Support - HowToDoInJava
Learn to setup your machine with Eclipse IDE and Java 16. Note that Eclipse provides Java 16 support out of the box in...
Read more >OpenJDK Life Cycle and Support Policy - Red Hat Customer ...
Here is the way to upgrade OpenJDK. How to upgrade java openJDK 1.6 to openJDK 1.7 in RHEL6? : https://access.redhat.com/solutions/2042263.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I added https://github.com/Cosium/git-code-format-maven-plugin/blob/master/README.md#jdk-16-peculiarities to the README.
The plugin can format/verify code at 2 occasions:
To my knowledge, the only way to pass java options for the first case would be to fork a new VM (the same way maven surefire plugin does when asked for). That seems a little overkill for our usecase.
Meanwhile, I think using https://maven.apache.org/configure.html#mvn-jvm-config-file should cleanly solve your issue.