Java Telegram Bot发生了非法的反射访问操作

卡林

我一直在使用该尝试使用Java运行Telegram机器人。我使用Gradle设置项目以使用依赖项。

我的项目层次结构如下:

.gradle
build
gradle
src
 -main
  -java
   -Main.java
   -MyAmazingBot.java
build.gradle
gradlew
gradlew.bat

这是我用来设置Gradle指南我使用了Gradle Wrapper来运行我的构建。

但是,我收到以下警告:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/C:/Users/addis/.gradle/caches/modules-2/files-2.1/com.google.inject/guice/4.1.0/eeb69005da379a10071aa4948c48d89250febb07/guice-4.1.0.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

但是该机器人运行良好(它回显了我的信息)。

1)此消息是否值得关注?

2)是否可以使用运行jar文件java -jar我收到一条消息no main manifest attribute, in .\build\libs\fsc2.jar

3)是否可以./gradlew run不使用Gradle的包装器运行

斯蒂芬·C

显然,这是由于Guice与Java 9不兼容。请参见下面的问题链接。

尚无修复。然而

  • 这只是一个警告,
  • 问题注释中有解决方法,可以关闭所有这些非法访问警告。

问题链接:

我认为Gradle实际上并没有错。看来问题出在Telegram / Guice / Cglib中。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章