Hi,
Background:
- Building using maven.
- Using lombok 1.6.10 as a maven build plugin.
- The source and target versions are 1.8.
- Using Oracle JDK.
- The machine is Ubuntu 16.04.
- The problem occurs on my machine, but doesn't occur on colleagues' machines.
Problem:
- When using mvn clean compile, this exception is thrown:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project dummy-name-for-privacy: Fatal error compiling: java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor (in unnamed module @0x1e4c6583) 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 @0x1e4c6583 -> [Help 1]
Steps:
- Was using Oracle JDK9.
- The code was compiling fine.
- After some changes in the code, all of a sudden, it started throwing this exception.
- Switched to
Oracle JDK8 (because of
this issue) but the problem still persists. I have both
JDK9&8 installed, but switched using
update-alternatives. Can confirm the switch by using `java -version` and `javac -version` which prints something like
javac 1.8.0_111Also, tried deleting ~/.m2/repository/org/projectlombok and then compiling but the problem didn't go away.
My guess: There're cached files of some library/project somewhere that were compiled Oracle JDK9 and the problem would go away by deleting them.
So, any help on how to solve that problem?
Thanks!