There two possible causes to this issue that I know of:
Java dependency conflict
If you have installed a package that also relies on Apache POI, such as xlsx, incorrect classes will be loaded. If you restart your R session and avoid loading the conflicting package, this issue should be avoided.
Failed download of java dependencies
Once you have installed XLConnect (using version 1.0.4 currently on CRAN), check that the java directory under the package's installation[0] contains the following:
ls /your/library/path/XLConnect/java/
commons-codec-1.15.jar commons-compress.jar curvesapi-1.06.jar poi.jar poi-ooxml-schemas.jar XLConnect-1.0.3.jar
commons-collections4.jar commons-math3.jar ooxml-schemas.jar poi-ooxml.jar SparseBitSet.jar xmlbeans.jar
If one of these is missing, remove the package, restart your R session, and reinstall the package. Check for any errors that occur in that last step.
[0] to find your library path, run .libPaths()
in your R session.