Errors trying to build, run Java runtime tests on fresh M1 mac with java 16
See original GitHub issueI 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:
- Created 2 years ago
- Comments:12 (12 by maintainers)
Top 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 >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
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.
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