13

my question somewhat relates to this post: Gradle build fails on Lombok annotated classes I am using jhipster and lombok 1.16.18 with a build.gradle as follows

...
apply plugin: 'net.ltgt.apt'
...
dependencies {
    provided "org.projectlombok:lombok:${lombok_version}"
    apt "org.projectlombok:lombok:${lombok_version}"
}
...

but get the following error during compileJava:

warning: lombok.javac.apt.LombokProcessor could not be initialized. 
Lombok will not run during this compilation: 
java.lang.IllegalArgumentException: com.sun.tools.javac.api.ClientCodeWrapper$WrappedStandardJavaFileManager extends com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager implements javax.tools.StandardJavaFileManager

What am I missing here?

werwuifi
  • 347
  • 1
  • 4
  • 14
  • Please edit your question and paste output of `gradlew -v` – Gaël Marziou Nov 24 '17 at 13:30
  • ------------------------------------------------------------ Gradle 4.2.1 ------------------------------------------------------------ Build time: 2017-10-02 15:36:21 UTC Revision: a88ebd6be7840c2e59ae4782eb0f27fbe3405ddf Groovy: 2.4.12 Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015 JVM: 9.0.1 (Oracle Corporation 9.0.1+11) OS: Mac OS X 10.13.1 x86_64 – werwuifi Nov 24 '17 at 13:45

4 Answers4

17

Output of gradlew -v shows that you are using JDK 9 which is not supported by JHipster 4.10.2, please use JDK 8. Same for Lombok.

------------------------------------------------------------ Gradle 4.2.1 -------
Build time: 2017-10-02 15:36:21 UTC 
Revision: a88ebd6be7840c2e59ae4782eb0f27fbe3405ddf 
Groovy: 2.4.12 
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015 
JVM: 9.0.1 (Oracle Corporation 9.0.1+11) 
OS: Mac OS X 10.13.1 x86_64
Gaël Marziou
  • 15,258
  • 4
  • 38
  • 47
5

I was facing the similar warning in my project as we moved from JDK 8 to JDK 9.

Upgrading the lombok version helped me with removing the error.

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.16.20</version>
            <scope>provided</scope>
        </dependency>

I found the reference over here https://github.com/rzwitserloot/lombok/issues/1541

hemanto
  • 1,602
  • 14
  • 16
1

if you are using gradle this has worked for me

dependencies {    annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.16'}
felipe
  • 1,009
  • 1
  • 11
  • 26
0

I had a similar problem, it turned out I was messing with my project setting and inadvertently set project JVM to 11, instead of the "correct" one, which was 8.

Reset it back to 8, working agian

Nestor Milyaev
  • 4,784
  • 1
  • 31
  • 43