Skip to content
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

Cannot access legacy Javac API #11

Open
stefan-reich opened this issue Aug 8, 2021 · 2 comments
Open

Cannot access legacy Javac API #11

stefan-reich opened this issue Aug 8, 2021 · 2 comments

Comments

@stefan-reich
Copy link

stefan-reich commented Aug 8, 2021

Output of mvn generate-sources:

[ERROR] : Fatal error - cannot access legacy Javac API: Unable to make field public com.sun.tools.javac.code.Type com.sun.tools.javac.tree.JCTree.type accessible: module jdk.compiler does not "exports com.sun.tools.javac.tree" to unnamed module @c6634d

JDK 16 on Linux

I have to pass some add-opens options to the VM, right?

@mbelt
Copy link

mbelt commented Dec 1, 2021

Or downgrade to JDK 11.

@kohlschuetter
Copy link

kohlschuetter commented Oct 7, 2023

Try this

MAVEN_OPTS="--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \
--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED" \
mvn clean install -DskipSigning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants