R XLConnect:loadWorkbook 警告 - “发生了非法反射访问操作”

Dan*_*Cee 3 java warnings r xlsx

我正在使用 XLConnect 读取 R(版本 3.4.4)中的 xlsx 文件,但收到以下警告。我认为它们可能与Java有关,但我不是Java用户,我不知道如何让它们消失。谢谢!

MWE 与任何 xlsx 文件:

library(XLConnect)
infile <- 'any.xlsx'
wb <- loadWorkbook(infile)
mydf <- readWorksheet(wb, sheet=1, region='A1:AS91', header=TRUE, check.names=FALSE, useCachedValues=TRUE)
Run Code Online (Sandbox Code Playgroud)

警告:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.poi.openxml4j.util.ZipSecureFile$1 (file:/usr/local/lib/R/site-library/XLConnect/java/poi-ooxml-3.17.jar) to field java.io.FilterInputStream.in
WARNING: Please consider reporting this to the maintainers of org.apache.poi.openxml4j.util.ZipSecureFile$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
Run Code Online (Sandbox Code Playgroud)

小智 5

从错误报告中,我可以告诉您正在使用 Java 9 或更高版本,不是吗?

这个警告将在 Apache POI 4.0.0 的下一个版本中得到解决。

Apache POI 4.0.0 发布后,XLConnect 的维护者将能够升级其依赖项。届时您将必须升级项目中 XLConnect 的版本,并且警告将不再出现。

或者,如果您不依赖最新版本来满足任何其他需求,则可以将已安装的 Java 运行时环境降级到 JRE 1.8.161。