XLConnectJars
is a support package used by XLConnect, a platform-independent interface to Microsoft Excel. In order for XLConnectJars
to install correctly, one must also install the rJava
package.
The error noted in the OP indicates that rJava did not install correctly.
error: DLL 'rJava' not found: maybe not installed for this architecture?
Many people encounter problems installing rJava because it cannot access the Java Runtime from the operating system. Solutions to the "unable to access Java runtime" problem vary by operating system.
Windows
People often have 32-bit Java installed and then use 64-bit R. The 64-bit version of R requires the 64-bit version of Java.
Solution: Install the 64-bit version of the Java Runtime for Windows from the Java Download web page.
MacOS
Details to configure rJava on MacOS are covered in another SO answer I posted, Unable to load rJava in RStudio, which I am reposting here for convenience.
There is a very specific sequence of steps that must be taken to get rJava to work on a Macbook, as documented in rJava Issues #86.
- Download and install Java from Oracle
- Uninstall any previously installed version of rJava
- Add JAVA_HOME to your .bashrc
- Close & restart terminal, R and RStudio sessions so they pick up the updated JAVA_HOME
- Use install.packages() to install rJava
See the URL link above for additional details on each step.
Ubuntu Linux
Use the Advanced Packaging Tool to install Java, then reconfigure Java support in R.
sudo apt-get install openjdk-8-jdk # openjdk-9-jdk has some installation issues
sudo R CMD javareconf
Once these steps are completed, install the XLConnectJars package with install.packages("XLConnectJars")
.
NOTE: some of this content is adapted from an article I previously posted on my Github site, Common Problems with Java and the xlsx Package.