title: rJava is not picking up the correct Java version
body: <p>I've been struggling with this problem for a while now. When I install rJava from R, it takes Java 1.6 instead of 1.8. I am using MAC OS 10.8.5 and these are the steps that I've already done.</p>
  
  <p>I've installed R.<br>
  I have both Java 1.6 and 1.8 on my machine.<br>
  I've reconfigures R from terminal using: <code>sudo R CMD javareconf -n</code>.<br>
  Here is what the output looks like:</p>
  
  <pre>
  Java interpreter : /usr/bin/java
  Java version     : 1.8.0_25
  Java home path   : /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre
  Java compiler    : /usr/bin/javac
  Java headers gen.: /usr/bin/javah
  Java archive tool: /usr/bin/jar
  Non-system Java on OS X
  </pre>
  
  <p>trying to compile and link a JNI progam </p>
  
  <pre>
  detected JNI cpp flags    : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/darwin
  detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
  gcc -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/../include -I/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/../include/darwin -I/usr/local/include    -fPIC  -mtune=core2 -g -O2  -c conftest.c -o conftest.o
  gcc -arch x86_64 -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -L/usr/local/lib -o conftest.so conftest.o -L/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/server -ljvm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
  
  
  JAVA_HOME        : /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre
  Java library path: $(JAVA_HOME)/lib/server
  JNI cpp flags    : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/darwin
  JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
  
  </pre>
  
  <p>Then I went on to R and installed rJava package as source like this:
  <code>install.packages("rJava", type="source")</code>
  and I get to <code>DONE(rJava)</code>     </p>
  
  <p>then when I check the version using:</p>
  
  <pre>
  library(rJava)
  .jinit()
  .jcall("java/lang/System", "S", "getProperty", "java.runtime.version")
  </pre>
  
  <p>I still get <code>1.6.0_25-b17</code> instead of <code>1.8</code></p>
  
  <p>Please let me know if you know the solution to this.</p>