简体   繁体   中英

java build fails with gradle

I am very new to JAVA. I just cloned a springboot microservice . I am trying to build it using ./gradlew clean build Also I am using IntelliJ IDEA Ultimate.

I am getting the following error.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor (in unnamed module @0x68f76bb8) 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 @0x68f76bb8

I am using openjdk17 if that matters. I also seem to have managed to install adoptopenjdk8 . How can i fix the above error?

Also since I am using gradle, how do I know which version of Java was used to write the service?

from command line check maven version

mvn -v

install lombok plugin from intellij idea

got to file -> settings -> plugin then search lombok then install it.

you have to check also from gradle file is there lombok dependecy is available or not. if available then update with new version

set java path

Windows 10 and Windows 8
- In Search, search for and then select: System (Control Panel)
- Click the Advanced system settings link.
- Click Environment Variables. In the section System Variables find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
- In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.
- open cmd check javac command

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM