I have a need to export some R data to formatted excel files and have successfully used both the XLConnect and xlsx packages in R before. I recently moved to 64 bit R and can't get either to work. I worked through some Oracle/Java architecture conflicts in a bunch of other packages. I am sure there is something similar going on here, but I can't crack it.
when I call library(XLConnect)
, rJava
and XLConnectJars
attach without issue.
Here is the error and session info:
> library(XLConnect)
Loading required package: XLConnectJars
Error : .onLoad failed in loadNamespace() for 'XLConnect', details:
call: .jfindClass(as.character(class))
error: class not found
Error: package or namespace load failed for ‘XLConnect’
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] XLConnectJars_0.2-12
loaded via a namespace (and not attached):
[1] rsconnect_0.4.3 tools_3.3.1 rJava_0.9-8
I get a similar error when I try to attach xlsx
.
> library(xlsx)
Loading required package: rJava
Loading required package: xlsxjars
Error : .onAttach failed in attachNamespace() for 'xlsx', details:
call: .jnew("org/apache/poi/xssf/usermodel/XSSFWorkbook")
error: java.lang.UnsupportedClassVersionError: Bad version number in .class file
Error: package or namespace load failed for ‘xlsx’
If I switch to 32 bit R, everything runs fine with both XLConnect
and xlsx
. I really need to run 64 bit R for other requirements.