title: Problems when trying to load a package in R due to rJava
body: <p>When I type <code>require(xlsx)</code> in order to load the package <code>xlsx</code> in R, the following messages is shown:</p>
  
  <pre><code>&gt; require(xlsx)
  Loading required package: xlsx
  Loading required package: xlsxjars
  Loading required package: rJava
  Error : .onLoad failed in loadNamespace() for 'rJava', details:
    call: fun(libname, pkgname)
    error: JAVA_HOME cannot be determined from the Registry
  Failed with error:  ‘package ‘rJava’ could not be loaded’
  </code></pre>
  
  <p>I've also tried to load the <code>rJava</code> package manually but got this error message:</p>
  
  <pre><code>require(rJava)
  Loading required package: rJava
  Error : .onLoad failed in loadNamespace() for 'rJava', details:
    call: fun(libname, pkgname)
    error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures.
  </code></pre>
  
  <p>Do you have any suggestion on how to solve the problem?</p>