ReporteRs :: docx;错误.onLoad函数失败,包'rJava'的'loadNamespace()'

时间:2020-10-20 10:56:57

标签: r rjava reporters

我需要ReporteRsrJava软件包的帮助。我知道我应该考虑使用officer软件包,但是我从使用ReporteRs的队友那里收到了一个大脚本。

这是我尝试使用ReporteRs软件包时收到的错误:

> Doc <- ReporteRs::docx(title = "OutputName")
Error in .jnew(class.docx4r.document) : 
  java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
In addition: Warning message:
Function docx is deprecated, please use officer::read_docx() instead. 

我一直在寻找解决方案,并且知道ReporteRs需要适当的Java版本-因此我安装了jre-8u172(windows-x64)并重新启动了R会话。然后,通过以下行:JAVA-PATH向新安装的JRE指示变量Sys.setenv(JAVA_HOME="C:/Program Files/Java/jre1.8.0_172/bin")。不幸的是,当我想再次使用ReporteRs软件包时,收到以下错误:

> Doc <- ReporteRs::docx(title = "OutputName")
Error: .onLoad failed 'loadNamespace()' for  'rJava', details:
  call: inDL(x, as.logical(local), as.logical(now), ...)
  error:  unable to load shared object 'C:/Users/jacob/Documents/R/R-3.6.3/library/rJava/libs/x64/rJava.dll':
  LoadLibrary failure:  The specified module could not be found.

我也在寻找该错误的解决方案,我发现this,他们建议确保我安装了适合我的R环境(32或64位)的Java。我的R是64位,Java也是64位。 我的ReporteRs版本是0.8.11.001,rJava版本是0.9-12。

有人可以帮我吗?

0 个答案:

没有答案