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.

Errors trying to build, run Java runtime tests on fresh M1 mac with java 16

See original GitHub issue

I get with this error via command line:

$ mvn -DskipTests clean install
...
Java version: 16.0.2, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home
...
[INFO] ANTLR 4 Runtime Tests (2nd generation) ............. FAILURE [ 12.637 s]
...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project antlr4-runtime-testsuite: Fatal error compiling: java.lang.IllegalAccessError: class org.antlr.v4.test.runtime.CommentHasStringValueProcessor (in unnamed module @0x2c7df4fa) cannot access class com.sun.tools.javac.model.JavacElements (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.model to unnamed module @0x2c7df4fa -> [Help 1]

Adding a series of these to maven-compiler-plugin from this doc doesn’t help:

<configuration>
      ...
      <fork>true</fork>
      <compilerArgs>
                            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
parrtcommented, Dec 5, 2021

Ok, I will try to just build within intellij for now. It looks like it might be a problem to merge the PR because java 8 does not like those parameters or something as it’s not compiling.

1reaction
KvanTTTcommented, Dec 5, 2021

Also, it seems like Java 7 does not support compilerArgs in pom. I think it’s the right time to update it, see https://github.com/antlr/antlr4/discussions/3369

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apple silicon(M1) 11.4 get a java error (jdk16) - Stack Overflow
JDK15 installed via Zulu. Someone says that everything is fine with JDK16(Zulu), and I don't know why. java ...
Read more >
Java Development on an Apple M1 (ARM64) - rieckpil
Collection of pitfalls, tips & tricks, and workarounds for Java development on an Apple M1 processor (ARM64): Testcontainers, Docker, ...
Read more >
Java Runtime not found | Apple Developer Forums
Today it can't find Java. Research says to check the Java icon in the System Preferences. But there is no Java icon in...
Read more >
How to solve “Unable to locate a Java Runtime that supports ...
@ekkis what is your Java version ? Per their website, you need a java 1.8. I've tried with Java 16 and got an...
Read more >
How do I install Java for my Mac?
Platform(s): Mac OS X, macOS; Java version(s): 8.0. Mac System Requirements for Oracle Java 7 and later versions. Intel-based Mac running versions ...
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