title: R Studio installing xlsx package
body: <p>I'm trying to install the xlsx package using R Studio but I am encountering some problems. When the installation process starts I am asked the question "Package which is only available in source form, and may need compilation of C/C++/Fortran:‘rJava’ Do you want to attempt to install these from sources?" to which I reply "y".</p>
  
  <p>The program then goes on to download 3 .tar.gz files. I have copied the full code below. </p>
  
  <p>Problem is, I'm not sure what I need to do next in order to complete the installation? Any help is greatly appreciated. </p>
  
  <pre><code>&gt; install.packages("xlsx")
  also installing the dependencies ‘rJava’, ‘xlsxjars’
  
  Package which is only available in source form, and may need compilation of                C/C++/Fortran:
  ‘rJava’
  Do you want to attempt to install these from sources?
  y/n: y
  installing the source packages ‘rJava’, ‘xlsxjars’, ‘xlsx’
  
  trying URL 'https://cran.rstudio.com/src/contrib/rJava_0.9-7.tar.gz'
  Content type 'application/x-gzip' length 711181 bytes (694 KB)
  downloaded 694 KB
  
  trying URL 'https://cran.rstudio.com/src/contrib/xlsxjars_0.6.1.tar.gz'
  Content type 'application/x-gzip' length 9477071 bytes (9.0 MB)
  downloaded 9.0 MB
  
  trying URL 'https://cran.rstudio.com/src/contrib/xlsx_0.5.7.tar.gz'
  Content type 'application/x-gzip' length 312839 bytes (305 KB)
  downloaded 305 KB
  
  * installing *source* package 'rJava' ...
  ** package 'rJava' successfully unpacked and MD5 sums checked
  Generate Windows-specific files (src/jvm-w32) ...
  make: Entering directory        `/cygdrive/c/Users/davish/AppData/Local/Temp/RtmpmOuT4w/R.INSTALL456448961b13/rJ    ava/src/jvm-w32'
  dlltool --as as -m i386:x86-64 --as-flags --64 --input-def jvm64.def --kill-     at --dllname jvm.dll --output-lib libjvm.dll.a
  gcc -m64 -O2 -c -o findjava.o findjava.c
  gcc -m64 -s -o findjava.exe findjava.o
  make: Leaving directory    `/cygdrive/c/Users/davish/AppData/Local/Temp/RtmpmOuT4w/R.INSTALL456448961b13/rJ    ava/src/jvm-w32'
  Find Java...
  ERROR*&gt; JavaSoft\{JRE|JDK} can't open registry keys.
  ERROR: cannot find Java Development Kit.
     Please set JAVA_HOME to specify its location manually
  Warning: running command 'sh ./configure.win' had status 1
  ERROR: configuration failed for package 'rJava'
  * removing 'C:/Program Files/R/R-3.2.2/library/rJava'
  Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" CMD INSTALL -l      "C:\Program Files\R\R-3.2.2\library"      C:\Users\davish\AppData\Local\Temp\Rtmp2FwjgL/downloaded_packages/rJava_0.9-    7.tar.gz' had status 1
  Warning in install.packages :
  installation of package ‘rJava’ had non-zero exit status
  ERROR: dependency 'rJava' is not available for package 'xlsxjars'
  * removing 'C:/Program Files/R/R-3.2.2/library/xlsxjars'
  Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" CMD INSTALL -l    "C:\Program Files\R\R-3.2.2\library"    C:\Users\davish\AppData\Local\Temp\Rtmp2FwjgL/downloaded_packages/xlsxjars_0.6.1 .tar.gz' had status 1
  Warning in install.packages :
  installation of package ‘xlsxjars’ had non-zero exit status
  ERROR: dependencies 'rJava', 'xlsxjars' are not available for package 'xlsx'
  * removing 'C:/Program Files/R/R-3.2.2/library/xlsx'
  Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" CMD INSTALL -l   "C:\Program Files\R\R-3.2.2\library"   C:\Users\davish\AppData\Local\Temp\Rtmp2FwjgL/downloaded_packages/xlsx_0.5.7.tar    .gz' had status 1
  Warning in install.packages :
  installation of package ‘xlsx’ had non-zero exit status
  
  The downloaded source packages are in
  ‘C:\Users\davish\AppData\Local\Temp\Rtmp2FwjgL\downloaded_packages’
  </code></pre>