question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What steps will reproduce the problem? Steps to reproduce the behavior:

  1. Use openjdk 16
  2. Run mvn git-code-format:format-code
  3. 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:closed
  • Created 2 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

0reactions
reda-alaouicommented, Jul 8, 2021

The plugin can format/verify code at 2 occasions:

  • after a manual trigger
  • after a commit

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found