简体   繁体   English

环境(在模块 jdk.compiler 中),因为模块 jdk.compiler 不会将 com.sun.tools.javac.processing 导出到未命名的模块

[英]Environment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module

I want to using GraalVM in my Spring Boot 2.3.10.RELEASE project because it can decrease the memory usage of JVM(Now I am using JDK 11), so I add the dependencies:我想在我的 Spring Boot 2.3.10.RELEASE 项目中使用 GraalVM,因为它可以减少 JVM 的内存使用量(现在我使用的是 JDK 11),所以我添加了依赖项:

api "org.springframework.experimental:spring-native:0.10.2"

add the gradle plugin:添加 gradle 插件:

apply plugin: "com.github.ayltai.spring-graalvm-native-plugin"

add native build config:添加原生构建配置:

nativeImage {
        mainClassName              = 'com.dolphin.soa.manage.AppStarter'
        traceClassInitialization   = true
        reportExceptionStackTraces = true
        removeUnusedAutoConfig     = true
        removeYamlSupport          = true
        removeSpelSupport          = true
        removeJmxSupport           = true
        maxHeapSize                = '4G'
}

finnaly I am using this Gradle(7.0) command to build a native jar:最后我正在使用这个 Gradle(7.0) 命令来构建一个原生 jar:

./gradlew clean :dolphin-manage:dolphin-manage-service:bootBuildImage -x test

but show this error:但显示此错误:

> Configure project :dolphin-acientbay
/Users/dolphin/source/retire
> Configure project :dolphin-post
/Users/dolphin/source/retire
> Configure project :dolphin-template
/Users/dolphin/source/retire
> Task :dolphin-common:compileJava FAILED

FAILURE: Build failed with an exception.

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

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6m 49s
5 actionable tasks: 1 executed, 4 up-to-date
(base)

is it a compatible problem about GraalVM and lombok?这是关于 GraalVM 和 lombok 的兼容问题吗? is it possible to fix it?有可能修复它吗?

I'm seeing this same type of error running spotless on my Java project.我在我的 Java 项目中看到同样类型的错误运行得一尘不染。 I just reported a bug about this to them: https://github.com/diffplug/spotless/issues/1244我刚刚向他们报告了一个关于此的错误: https ://github.com/diffplug/spotless/issues/1244

I diagnosed the problem as some kind behavioral change between Java 15 and Java 16. So one thing you can do is revert to an earlier version of Java to see if that makes the issue go away.我将问题诊断为 Java 15 和 Java 16 之间的某种行为变化。因此,您可以做的一件事是恢复到 Java 的早期版本,看看这是否会使问题消失。 If it does, you should report a bug similar to what I did to the project with the problem so they can try to fix it.如果是这样,您应该报告一个类似于我对有问题的项目所做的错误,以便他们可以尝试修复它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 模块 jdk.compiler 不会“打开 com.sun.tools.javac.processing”到未命名的模块 @4bae33a6 - module jdk.compiler does not “opens com.sun.tools.javac.processing” to unnamed module @4bae33a6 模块 jdk.compiler 不会“打开 com.sun.tools.javac.processing” - module jdk.compiler does not "opens com.sun.tools.javac.processing" Java 11 将 jdk.compiler/com.sun.tools.javac 类包含到项目中 - Java 11 include jdk.compiler/com.sun.tools.javac classes into project Java, Intellij IDEA 问题 Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED - Java, Intellij IDEA problem Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED 获取值为 Class<!--?--> 使用 jdk.compiler 模块进行注释 - Get value as Class<?> for an Annotation using the jdk.compiler module 无法在 Intellij 中编译 - 错误:java:不允许使用 --release 从系统模块 jdk.compiler 导出包 - Unable to compile in Intellij - Error:java: exporting a package from system module jdk.compiler is not allowed with --release LdapCtxFactory 因为模块 java.naming 不导出 com.sun.jndi.ldap 到未命名的模块 - LdapCtxFactory because module java.naming does not export com.sun.jndi.ldap to unnamed module JDK编译器“打开”模块失败 - JDK compiler fails for “open” module OLP CLI 错误:java.base 不会将 sun.security.util 导出到 JDK 16 下的未命名模块 - OLP CLI error: java.base does not export sun.security.util to unnamed module under JDK 16 Lombok 访问 jdk.compiler 的内部包与 Java-16 不兼容 - Lombok's access to jdk.compiler's internal packages incompatible with Java-16
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM