cincheo / jsweet-quickstart

A template project to start with JSweet Java to TypeScript transpiler.
Apache License 2.0
17 stars 9 forks source link

Cannot access legacy Javac API #11

Open stefan-reich opened 2 years ago

stefan-reich commented 2 years ago

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 commented 2 years ago

Or downgrade to JDK 11.

kohlschuetter commented 9 months ago

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