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

Allow running with --illegal-access=deny #2662

Closed
Thihup opened this issue Nov 27, 2020 · 3 comments
Closed

Allow running with --illegal-access=deny #2662

Thihup opened this issue Nov 27, 2020 · 3 comments

Comments

@Thihup
Copy link

Thihup commented Nov 27, 2020

Describe the bug
As of JDK 15, the default value for illegal-access is permit, however there is a proposal to change to deny in JDK 16 and deprecate the --illegal-access parameter. We can already simulate the by compiling with --illegal-access=deny.

To Reproduce

/jvms/jdk-15/bin/javac -J--illegal-access=deny -cp ~/.m2/repository/org/projectlombok/lombok/1.18.16/lombok-1.18.16.jar /tmp/EmptyClass.java

An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor (in unnamed module @0xa74868d) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module @0xa74868d
        at lombok.javac.apt.LombokProcessor.getJavacProcessingEnvironment(LombokProcessor.java:433)
        at lombok.javac.apt.LombokProcessor.init(LombokProcessor.java:92)
        at lombok.core.AnnotationProcessor$JavacDescriptor.want(AnnotationProcessor.java:160)
        at lombok.core.AnnotationProcessor.init(AnnotationProcessor.java:213)
        at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init(AnnotationProcessor.java:64)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:702)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:829)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:925)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1269)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1383)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1261)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:935)
        at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:317)
        at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:176)
        at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:59)
        at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:45)

Expected behavior
I hope that would be possible to work as illegal-access=permit however I'm aware that maybe not possible.

Version info (please complete the following information):

  • Lombok version: 1.18.6
@rspilker
Copy link
Collaborator

rspilker commented Dec 4, 2020

It should be possible by adding a bunch of --ADD-OPENS (or something like that) parameters to the javac invocation. And that's the way the people at Oracle seem to want.

@rspilker
Copy link
Collaborator

rspilker commented Dec 4, 2020

@Thihup
Copy link
Author

Thihup commented Mar 16, 2021

Duplicate of #2681

@Thihup Thihup closed this as completed Mar 16, 2021
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

2 participants