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

Java 16 support : Reflection issue in the compiler? #751

Open
kspalaiologos opened this issue Mar 25, 2023 · 2 comments
Open

Java 16 support : Reflection issue in the compiler? #751

kspalaiologos opened this issue Mar 25, 2023 · 2 comments

Comments

@kspalaiologos
Copy link

Hello. I am using JSweet and its Maven plugin. When trying to generate JS code, I stumble upon the following error from the compiler:

[INFO] --- jsweet-maven-plugin:3.1.0:jsweet (default-cli) @ maja ---
[INFO] JSweet transpiler version 3.1.0 (build date: 2021-04-21 20:24:55)
[WARNING] dependency type not-jar excluded from candies detection: Dependency {groupId=org.junit.jupiter, artifactId=junit-jupiter, version=5.9.2, type=jar}
[WARNING] dependency type not-jar excluded from candies detection: Dependency {groupId=org.assertj, artifactId=assertj-core, version=3.24.2, type=jar}
dependency type not-jar excluded from candies detection: Dependency {groupId=org.assertj, artifactId=assertj-core, version=3.24.2, type=jar}

I'm not sure if the transpiler didn't catch onto the fact that junit/assertj are not needed for the production build, but the greater issue here is the following error:

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 @604b1e1d

I think that JSweet is not compatible with Java16, but it doesn't seem like this is stated anywhere. Regardless, J16 support would be amazing.

@lgrignon
Copy link
Collaborator

Hello, yes unfortunately JSweet 3 brought support for Java 11 but was not tested for more recent versions.
Note : some users seem to use Java version over 11 without problem, but I am not sure which version breaks compatibility

@lgrignon lgrignon changed the title Reflection issue in the compiler? Java 16 support : Reflection issue in the compiler? Mar 26, 2023
@kohlschuetter
Copy link
Contributor

This should be fixed by using standalone compiler instead of relying on whatever JDK provides.
see PR #770 for details.

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

No branches or pull requests

3 participants