title: Why does rJava not work on Ubuntu 14.04 using OpenJDK 7?
body: <p>Hi I'm having issues with the rJava package from cran.</p>
  
  <p>I have installed</p>
  
  <pre><code>sudo apt-get install openjdk-7-jdk
  sudo apt-get install r-cran-rjava
  </code></pre>
  
  <p>and ran</p>
  
  <pre><code>sudo R CMD javareconf
  # Java interpreter : /usr/bin/java
  # Java version     : 1.7.0_55
  # Java home path   : /usr/lib/jvm/java-7-openjdk-amd64/jre
  # Java compiler    : /usr/bin/javac
  # Java headers gen.: /usr/bin/javah
  # Java archive tool: /usr/bin/jar
  </code></pre>
  
  <p>I then try to run R and load rJava and get the following error:</p>
  
  <pre><code>R
  &gt; library(rJava)
  Error : .onLoad failed in loadNamespace() for 'rJava', details:
    call: dyn.load(file, DLLpath = DLLpath, ...)
    error: unable to load shared object '/usr/lib/R/site-library/rJava/libs/rJava.so':
    libjvm.so: cannot open shared object file: No such file or directory
  Error: package or namespace load failed for ‘rJava’
  </code></pre>
  
  <p>I'm on Ubuntu 14.04 64 bit and am using R version 3.1.0 (2014-04-10) -- "Spring Dance"</p>
  
  <p>UPDATE: Actually this is not specific to OpenJDK, I just tried oracle java 8 and got the same result. Also I found this workaround <a href="https://stackoverflow.com/questions/16438073/unable-to-install-rjava-in-r-3-0-in-ubuntu-13-04" title="here">here</a> which I am reluctant to use since it is indeed a workaround and doesn't really explain why it's necessary. The package system should have handled this in my opinion. Seems like libjvm.so is the problem and I have it located here</p>
  
  <pre><code>/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/jamvm/libjvm.so
  /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
  /usr/lib/jvm/java-7-oracle/jre/lib/amd64/server/libjvm.so
  </code></pre>
  
  <p>and for some reason rJava fails to find them despite updating with sudo R CMD javareconf.</p>
  
  <p>UPDATE 2: The plot thickens: If I run R as sudo it works. </p>
  
  <p>Thankful for pointers.</p>