title: Had Java installed but failed to require package "XLConnect"
body: <blockquote>
    <p>Updated: After referring to the post here:
    <a href="https://stackoverflow.com/questions/30738974/rjava-load-error-in-rstudio-r-after-upgrading-to-osx-yosemite">rJava load error in RStudio/R after &quot;upgrading&quot; to OSX Yosemite</a>
    I have solved the problem. 
    This one was useful too.
    <a href="https://stackoverflow.com/questions/47658210/loading-rjava-on-mac-os-high-sierra">Loading rJava on Mac OS High Sierra</a></p>
  </blockquote>
  
  <p>I am trying to install and require package "XLConnect".
  And I have Java installed, when I was trying to update it.
  The screenshot I got was as below, showing I have a newer Java version.
  <a href="https://i.stack.imgur.com/Thqfs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Thqfs.png" alt="enter image description here"></a> </p>
  
  <p>The error messages I've got was as below, and I installed the package
  "XLConnectJars" as the error message mentioned it. But still did not solve the problem. I wonder have anybody had the same issue before? Any suggestion and assistance would be highly appreciated.</p>
  
  <pre><code>&gt; library("XLConnect")
  Loading required package: XLConnectJars
  Error: package or namespace load failed for ‘XLConnectJars’:
   .onLoad failed in loadNamespace() for 'rJava', details:
    call: dyn.load(file, DLLpath = DLLpath, ...)
    error: unable to load shared object 
  
  
  '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so':
  
  
  dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/lib/server/libjvm.dylib
            Referenced from: 
  
  /Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so
            Reason: image not found
          Error: package ‘XLConnectJars’ could not be loaded
          &gt; install.packages("XLConnectJars")
          trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/XLConnectJars_0.2-15.tgz'
          Content type 'application/x-gzip' length 14810717 bytes (14.1 MB)
          ==================================================
          downloaded 14.1 MB
  
  
          The downloaded binary packages are in
              /var/folders/v3/4tfsblxs1m314g6pl2bt4t7r0000gn/T//RtmpBJ5q5u/downloaded_packages
          &gt; library("XLConnectJars")
          Error: package or namespace load failed for ‘XLConnectJars’:
           .onLoad failed in loadNamespace() for 'rJava', details:
            call: dyn.load(file, DLLpath = DLLpath, ...)
            error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so':
            dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/lib/server/libjvm.dylib
            Referenced from: 
  
      /Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so
                Reason: image not found
  </code></pre>