Unable to install xlsx and rJava packages

Error Information:

Description of issue - When I'm running install.package("rJava") the following is displayed.

Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so
Reason: image not found

Steps taken so far - tried downloading from different crans, configuring java path but still the problem is persisting.

System Information:

  • RStudio Edition: (Desktop or Server)
  • RStudio Version: 1.2.5033
  • OS Version: Mac OS X 10_14_6
  • R Version: 3.6.2

Also:

  • RStudio diagnostics report:
  • Your sessionInfo():
  • RStudio crash report:
  • RStudio application log files:

From Troubleshooting Guide: Using RStudio

Hi @Meenakshi,

If you're just trying to write XLSX files, I recommend using the package openxlsx since it does not have the Java requirement. You can always read XLSX with readr also.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.