title: MacOS does not recognize updated Java on MacOS 10.14.6
body: <p>In the process of re-installing packages after updating R to 3.6.1 via Homebrew, I encountered this problem (running within RStudio 1.2.5019):</p>
  
  <pre><code>install.packages( "rJava" )
  ...
  ...
  ...
  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 ‘/usr/local/lib/R/3.6/site-library/rJava’
  </code></pre>
  
  <p>Running</p>
  
  <pre><code>bash-3.2$ sudo R CMD javareconf
  </code></pre>
  
  <p>yields</p>
  
  <pre><code>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
  
  trying to compile and link a JNI program 
  detected JNI cpp flags    : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/darwin
  detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
  clang -I"/usr/local/Cellar/r/3.6.1_1/lib/R/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/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include  -fPIC  -g -O2  -c conftest.c -o conftest.o
  clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/Cellar/r/3.6.1_1/lib/R/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/readline/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 -L/usr/local/Cellar/r/3.6.1_1/lib/R/lib -lR -lintl -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
  Updating Java configuration in /usr/local/Cellar/r/3.6.1_1/lib/R
  Done.
  </code></pre>
  
  <p>Re running <code>install.packages( "rJava" )</code> yields a slightly different error message:</p>
  
  <pre><code>
  *** JDK is incomplete! Please make sure you have a complete JDK. JRE is *not* sufficient.
  configure: error: ./configure failed for jri
  ERROR: configuration failed for package ‘rJava’
  * removing ‘/usr/local/lib/R/3.6/site-library/rJava’
  Warning in install.packages :
    installation of package ‘rJava’ had non-zero exit status
  </code></pre>
  
  <p>But I noticed that the output of <code>R CMD javareconf</code> lists an old Java version: 1.8.0_25. Running <code>java -version</code> confirms:</p>
  
  <pre><code>java version "1.8.0_25"
  Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
  Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
  </code></pre>
  
  <p>Running <code>/usr/libexec/java_home -V</code> confirms that only 1.8.0_25 is installed (even after having downloaded and run the installer for the latest Java version):</p>
  
  <pre><code>Matching Java Virtual Machines (1):
      1.8.0_25, x86_64:   "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
  
  /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
  </code></pre>
  
  <p>Looking at the <a href="https://i.stack.imgur.com/dHi8Z.png" rel="nofollow noreferrer">Java Control Panel</a> shows that 1.8.0_231-b11 is supposedly installed.</p>
  
  <p>I have tried uninstalling Java and re-installing Java to no effect.</p>
  
  <p>Why the discrepancy? How do I get they OS to recognize the most current version?</p>
  
  <p>I'm running MacOS Mojave 10.14.6</p>
  
  <p>Thanks,</p>