0

I just downloaded xlsx package in R, but I just can't use the library. (On Mac)

> library(xlsx)
JavaVM: requested Java version ((null)) not available. Using Java at "" instead.
JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
JavaVM FATAL: Failed to load the jvm library.
Error : .onLoad failed in loadNamespace() for 'xlsx', details:
call: .jinit()
error: JNI_GetCreatedJavaVMs returned -1

Error: package or namespace load failed for ‘xlsx’

What am I doing wrong?

lrleon
  • 2,610
  • 3
  • 25
  • 38

1 Answers1

0

Make sure you have installed the dependencies:

  • xlsxjars
  • rJava

And, of course, if that does not work, verify you have the Java JDK installed in your mac: javac -version If not, just install it from here: https://java.com/en/download/faq/java_mac.xml

Guiem Bosch
  • 2,728
  • 1
  • 21
  • 37
  • Yes, I installed all of them. – Zizhen SONG Jan 26 '16 at 02:02
  • Okay, it must be certainly something with the Java version. Look I found almost the same problem here: http://stackoverflow.com/questions/34971966/how-does-one-configure-rjava-on-osx-to-select-the-right-jvm-jinit-failing Maybe you could keep track of this post and see if anyone can solve it, or maybe in the meanwhile I would try a new fresh java installation...? – Guiem Bosch Jan 26 '16 at 06:51
  • Thank you sooooooo much! I will keep track of this post. – Zizhen SONG Jan 27 '16 at 08:28