title: rJava image missing in Rstudio in OsX
body: <p>When I try to load library("rJava") in RStudio on OsX High Sierra, I get the error already mentioned about the image not being present:</p>
  
  <pre><code>Error: package or namespace load failed for 'rJava':
   .onLoad failed in loadNamespace() for 'rJava', details:
    call: dyn.load(file, DLLpath = DLLpath, ...)
    error: unable to load shared object '/Users/ognjenmilicevic/RPlay/Methylation_Mayo_Vesna_Garovic/libs/rJava/libs/rJava.so':
    dlopen(/Users/ognjenmilicevic/RPlay/Methylation_Mayo_Vesna_Garovic/libs/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
    Referenced from: /Users/ognjenmilicevic/RPlay/Methylation_Mayo_Vesna_Garovic/libs/rJava/libs/rJava.so
    Reason: image not found
  </code></pre>
  
  <p>I tried reconfiguring Java but the error persists: </p>
  
  <pre><code>$ R CMD javareconf
  Java interpreter : /usr/bin/java
  Java version     : 10.0.1
  Java home path   : /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home
  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"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home/include/darwin  -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -fPIC  -Wall -g -O2  -c conftest.c -o conftest.o
  clang -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 -o conftest.so conftest.o -L/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home/lib/server -ljvm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
  
  
  JAVA_HOME        : /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home
  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 /Library/Frameworks/R.framework/Resources
  Done.
  </code></pre>
  
  <p>Removing and reinstalling the package doesn't help. I tried pointing to my version by using:</p>
  
  <pre><code>dyn.load('/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home/lib/server/libjvm.dylib')
  </code></pre>
  
  <p>The error persists. All the while it works in R when ran as a command. Where is the path "/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib" coming from and how can I change it to point to my installation?</p>