[英]java build fails with gradle
我是 JAVA 的新手。我刚刚克隆了一个springboot microservice
。 我正在尝试使用./gradlew clean build
构建它我也在使用 IntelliJ IDEA Ultimate。
我收到以下错误。
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
如果重要的话,我正在使用openjdk17
。 我似乎也设法安装adoptopenjdk8
。 我该如何解决上述错误?
另外由于我使用的是gradle,我怎么知道Java是用哪个版本写的服务呢?
从命令行检查 maven 版本
mvn -v
从 intellij idea 安装 lombok 插件
得到文件 - >设置 - >插件然后搜索lombok然后安装它。
您还必须从 gradle 文件中检查 lombok 依赖项是否可用。 如果可用,则更新为新版本
设置 java 路径
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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.