maven:发生了非法的反射访问操作 [英] maven: An illegal reflective access operation has occurred

查看:146
本文介绍了maven:发生了非法的反射访问操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在执行任意 mvn 命令时,我会在日志开头收到以下警告:

At execution of any arbitrary mvn command I get following warnings at the beginning of the logs:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

不幸的是,这些警告有时会导致运行时出错并中断我的 maven 命令执行.有谁知道如何解决这个问题并摆脱这些警告?

Unfortunately, these warnings sometimes lead to errors at runtime and break my maven command execution. Does anyone know how to address this and get rid of these warnings?

我的 Maven 版本:

Apache Maven 3.5.2
Maven home: /usr/share/maven
Java version: 11.0.2, vendor: Azul Systems, Inc.
Java home: /usr/lib/jvm/zulu-11-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-47-generic", arch: "amd64", family: "unix"

推荐答案

我最好的猜测:您的 guice 版本与 Java 11 不兼容.

My best guess: your guice version is not compatible with Java 11.

这篇关于maven:发生了非法的反射访问操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆