Why do I get "JNI_GetCreatedJavaVMs returned -1" error while loading the xlsx package in R?
<p>I just downloaded xlsx package in R, but I just can't use the library. (On Mac)</p>

<pre><code>&gt; 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’
</code></pre>

<p>What am I doing wrong?</p>