title: Install rJava on centOS
body: <p>I have a problem installing rJava on a centOS VM (cloudera cdh3u4).</p>
  
  <p>I did this first: sudo R CMD javareconf</p>
  
  <pre><code>[cloudera@localhost ~]$ sudo R CMD javareconf
  Java interpreter : /usr/bin/java
  Java version     : 1.6.0_31
  Java home path   : /usr/java/jdk1.6.0_31/jre
  Java compiler    : /usr/bin/javac
  Java headers gen.:
  Java archive tool: /usr/bin/jar
  Java library path: $(JAVA_HOME)/lib/amd64/server:$(JAVA_HOME)/lib/amd64:$(JAVA_HOME)/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
  JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -L$(JAVA_HOME)/lib/amd64 -L$(JAVA_HOME)/../lib/amd64 -L/usr/java/packages/lib/amd64 -L/usr/lib64 -L/lib64 -L/lib -L/usr/lib -ljvm
  JNI cpp flags    : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux
  
  Updating Java configuration in /usr/lib64/R
  Done.
  </code></pre>
  
  <p>But I get this out when I'd like to install rJava:</p>
  
  <pre><code>&gt; install.packages( c('rJava'),
  + repos='http://cran.revolutionanalytics.com')
  
      ...
      configure: error: One or more Java configuration variables are not set.
      Make sure R is configured with full Java support (including JDK). Run
      R CMD javareconf
      as root to add Java support to R.
  
      If you don't have root privileges, run
      R CMD javareconf -e
      to set all Java-related variables and then install rJava.
  
      ERROR: configuration failed for package ‘rJava’
      * removing ‘/home/cloudera/R/x86_64-redhat-linux-gnu-library/2.15/rJava’
  
      The downloaded source packages are in
              ‘/tmp/RtmpR5V6t5/downloaded_packages’
      Warning message:
      In install.packages(c("rJava"), repos = "http://cran.revolutionanalytics.com") :
        installation of package ‘rJava’ had non-zero exit status
  </code></pre>
  
  <p>I'm not sure but does it mean that I need to install JDK? If yes, do you know a good site where I find a step-by-step info to install the right JDK for my case? 
  (My final purpose is to install rhdfs and rjava is a needed dependency for that)</p>