title: I cannot run R xlsx package on my Mac OS 10.11.5 - El Capitan
body: <p>I'm trying to run the xlsx package on R but returns this error: </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>I found this link here on Stackoverflow <a href="https://stackoverflow.com/questions/35179151/cannot-load-r-xlsx-package-on-mac-os-10-11">Cannot load R xlsx package on Mac OS 10.11</a>  but it isn't working for me. </p>
  
  <p>The solution was to run <code>sudo R CMD javareconf</code> on Mac Terminal and after <code>install.packages("rJava",type='source')</code> on R. But when I run <code>sudo R CMD javareconf</code> my Mac gives this error: <code>sudo: R: command not found</code>.</p>
  
  <p>Does anyone know how can I fix this issue?</p>
  
  <hr>
  
  <p>OS Version:</p>
  
  <pre><code>$ sw_vers
  ProductName:    Mac OS X
  ProductVersion: 10.11.5
  BuildVersion:   15F34
  </code></pre>
  
  <p>Java Version:</p>
  
  <pre><code>$ java -version
  java version "1.8.0_60"
  Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
  Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
  </code></pre>
  
  <p>R Version:</p>
  
  <pre><code>&gt; version
             _                           
  platform       x86_64-apple-darwin13.4.0   
  arch           x86_64                      
  os             darwin13.4.0                
  system         x86_64, darwin13.4.0        
  status                                     
  major          3                           
  minor          2.3                         
  year           2015                        
  month          12                          
  day            10                          
  svn rev        69752                       
  language       R                           
  version.string R version 3.2.3 (2015-12-10)
  nickname       Wooden Christmas-Tree
  </code></pre>