<div dir="ltr">I am encountering the same issue here, but when I got a different result as below, what should I do for the next?<div><div><div><br></div><div><div>> Sys.getenv("DYLD_FALLBACK_LIBRARY_PATH")</div><div>[1] "/Library/Frameworks/R.framework/Resources/lib:/Users/eileen/lib:/usr/local/lib:/usr/lib::"</div><div><br></div><div>Thanks,</div><div>Eileen<br><br>On Monday, February 15, 2016 at 6:15:04 AM UTC+8, Simon Urbanek wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Check DYLD_FALLBACK_LIBRARY_PATH - it must include your Java:
<br>
<br>> Sys.getenv("DYLD_FALLBACK_<wbr>LIBRARY_PATH")
<br>[1] "/Library/Frameworks/R.<wbr>framework/Resources/lib:/<wbr>Library/Java/<wbr>JavaVirtualMachines/jdk1.8.0_<wbr>20.jdk/Contents/Home/jre/lib/<wbr>server"
<br>
<br>if it doesn't, your R is not correctly configured. Oracle's Java requires the above setting, it doesn't work without it (unlike the system Java). The above is set by the R script based on etc/ldpaths - so make sure that one is correct (it should be by javareconf if your system is setup correctly).
<br>
<br>Cheers,
<br>Simon
<br>
<br>
<br>On Feb 14, 2016, at 6:47 AM, Berend Hasselman <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="juKFkuO7AAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">b...@xs4all.nl</a>> wrote:
<br>
<br>>
<br>>> On 14 Feb 2016, at 12:31, Prof Brian Ripley <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="juKFkuO7AAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">rip...@stats.ox.ac.uk</a>> wrote:
<br>>>
<br>>> On 14/02/2016 11:24, Berend Hasselman wrote:
<br>>>>
<br>>>>> On 14 Feb 2016, at 11:48, Prof Brian Ripley <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="juKFkuO7AAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">rip...@stats.ox.ac.uk</a>> wrote:
<br>>>>>
<br>>>>> Your Java is seriously old. Start by updating it (1.8.0_74 is current, AFAIK).
<br>>>>>
<br>>>>> I can reproduce this with the CRAN binary packages, but installing the packages from source works for me on El Capitan (using the CRAN binary R). So I suspect a problem with the CRAN binary package of rJava, which seems to be hard-coded to use /System/Library/Frameworks/<wbr>JavaVM.framework and not Oracle Java.
<br>>>>>
<br>>>>
<br>>>> I've just updated to Java 1.8.0_74.
<br>>>> I get the same issues.
<br>>>>
<br>>>>
<br>>>> And I have now also installed rJava, XLConnect end XLConnectJars from source.
<br>>>> library(XLConnect) gives this error
<br>>>>
<br>>>> <message>
<br>>>> Loading required package: XLConnectJars
<br>>>> Error : .onLoad failed in loadNamespace() for 'rJava', details:
<br>>>> call: dyn.load(file, DLLpath = DLLpath, ...)
<br>>>> error: unable to load shared object '/Users/berendhasselman/<wbr>Library/R/3.2/library/rJava/<wbr>libs/rJava.so':
<br>>>> dlopen(/Users/<wbr>berendhasselman/Library/R/3.2/<wbr>library/rJava/libs/rJava.so, 6): Library not loaded: @rpath/libjvm.dylib
<br>>>> Referenced from: /Users/berendhasselman/<wbr>Library/R/3.2/library/rJava/<wbr>libs/rJava.so
<br>>>> Reason: image not found
<br>>>> Error: package 'XLConnectJars' could not be loaded
<br>>>> </message>
<br>>>>
<br>>>> Apparently rJava.so can't be found. But I had already installed it from source.
<br>>>
<br>>> That is not what the message says ... it is libjvm which is not being found.
<br>>>
<br>>
<br>> Correct. Sorry about that.
<br>>
<br>>> Did you re-run R CMD javareconf? (You might need to reinstall rJava from source once you do.)
<br>>>
<br>>
<br>> Yes I did and have done so again. I've reinstalled rJava from source and get the same error and the same output of running otool -L on rJava.so.
<br>>
<br>> Berend
<br>>
<br>> Output of R CMD javareconf:
<br>>
<br>> Java interpreter : /usr/bin/java
<br>> Java version : 1.8.0_74
<br>> Java home path : /Library/Java/<wbr>JavaVirtualMachines/jdk1.8.0_<wbr>74.jdk/Contents/Home/jre
<br>> Java compiler : /usr/bin/javac
<br>> Java headers gen.: /usr/bin/javah
<br>> Java archive tool: /usr/bin/jar
<br>> Non-system Java on OS X
<br>>
<br>> trying to compile and link a JNI program
<br>> detected JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/<wbr>darwin
<br>> detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
<br>> clang -I/Library/Frameworks/R.<wbr>framework/Resources/include -DNDEBUG -I/Library/Java/<wbr>JavaVirtualMachines/jdk1.8.0_<wbr>74.jdk/Contents/Home/jre/../<wbr>include -I/Library/Java/<wbr>JavaVirtualMachines/jdk1.8.0_<wbr>74.jdk/Contents/Home/jre/../<wbr>include/darwin -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -fPIC -Wall -mtune=core2 -g -O2 -c conftest.c -o conftest.o
<br>> clang -dynamiclib -Wl,-headerpad_max_install_<wbr>names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.<wbr>framework/Resources/lib -L/usr/local/lib -o conftest.so conftest.o -L/Library/Java/<wbr>JavaVirtualMachines/jdk1.8.0_<wbr>74.jdk/Contents/Home/jre/lib/<wbr>server -ljvm -F/Library/Frameworks/R.<wbr>framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
<br>>
<br>>
<br>> JAVA_HOME : /Library/Java/<wbr>JavaVirtualMachines/jdk1.8.0_<wbr>74.jdk/Contents/Home/jre
<br>> Java library path: $(JAVA_HOME)/lib/server
<br>> JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/<wbr>darwin
<br>> JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
<br>> Updating Java configuration in /Library/Frameworks/R.<wbr>framework/Resources
<br>> Done.
<br>>
<br>>
<br>>
<br>>>
<br>>>> I have run otool on the installed rJava.so
<br>>>>
<br>>>> otool -L rJava.so
<br>>>> rJava.so:
<br>>>> rJava.so (compatibility version 0.0.0, current version 0.0.0)
<br>>>> @rpath/libjvm.dylib (compatibility version 1.0.0, current version 1.0.0)
<br>>>> /Library/Frameworks/R.<wbr>framework/Versions/3.2/<wbr>Resources/lib/libR.dylib (compatibility version 3.2.0, current version 3.2.3)
<br>>>> /System/Library/<wbr>Frameworks/CoreFoundation.<wbr>framework/Versions/A/<wbr>CoreFoundation (compatibility version 150.0.0, current version 1256.14.0)
<br>>>> /usr/lib/libSystem.B.<wbr>dylib (compatibility version 1.0.0, current version 1226.10.1)
<br>>>>
<br>>>> Berend
<br>>>>
<br>>>>> On 14/02/2016 09:22, Berend Hasselman wrote:
<br>>>>>> I have installed rJava, xlsx, xlsxjars, XLConnect and XLConnectJars.
<br>>>>>>
<br>>>>>> Executing library(xlsx) gives this output
<br>>>>>>
<br>>>>>> Loading required package: rJava
<br>>>>>> Loading required package: xlsxjars
<br>>>>>> Error : .onLoad failed in loadNamespace() for 'xlsx', details:
<br>>>>>> call: .jinit()
<br>>>>>> error: JNI_GetCreatedJavaVMs returned -1
<br>>>>>>
<br>>>>>> Error: package or namespace load failed for 'xlsx'
<br>>>>>> JavaVM: requested Java version ((null)) not available. Using Java at "" instead.
<br>>>>>> JavaVM: Failed to load JVM: /bundle/Libraries/libserver.<wbr>dylib
<br>>>>>> JavaVM FATAL: Failed to load the jvm library.
<br>>>>>>
<br>>>>>>
<br>>>>>> Executing library(XLConnect) gives this output
<br>>>>>>
<br>>>>>> Loading required package: XLConnectJars
<br>>>>>> Error : .onLoad failed in loadNamespace() for 'XLConnectJars', details:
<br>>>>>> call: .jinit()
<br>>>>>> error: JNI_GetCreatedJavaVMs returned -1
<br>>>>>>
<br>>>>>> Error: package 'XLConnectJars' could not be loaded
<br>>>>>> JavaVM: requested Java version ((null)) not available. Using Java at "" instead.
<br>>>>>> JavaVM: Failed to load JVM: /bundle/Libraries/libserver.<wbr>dylib
<br>>>>>> JavaVM FATAL: Failed to load the jvm library.
<br>>>>>>
<br>>>>>>
<br>>>>>> sessionInfo (after library(xlsx) and library(XLConnect)) and javareconf output below.
<br>>>>>>
<br>>>>>> What is going on?
<br>>>>>> What is the solution for this problem?
<br>>>>>>
<br>>>>>> Berend Hasselman
<br>>>>>>
<br>>>>>>
<br>>>>>> SessionInfo:
<br>>>>>>
<br>>>>>> R version 3.2.3 Patched (2016-02-13 r70160)
<br>>>>>> Platform: x86_64-apple-darwin13.4.0 (64-bit)
<br>>>>>> Running under: OS X 10.11.3 (El Capitan)
<br>>>>>>
<br>>>>>> locale:
<br>>>>>> [1] en_IE.UTF-8/en_IE.UTF-8/en_IE.<wbr>UTF-8/C/en_IE.UTF-8/en_IE.UTF-<wbr>8
<br>>>>>>
<br>>>>>> attached base packages:
<br>>>>>> [1] stats graphics grDevices utils datasets methods base
<br>>>>>>
<br>>>>>> other attached packages:
<br>>>>>> [1] xlsxjars_0.6.1 rJava_0.9-8
<br>>>>>>
<br>>>>>> loaded via a namespace (and not attached):
<br>>>>>> [1] tools_3.2.3
<br>>>>>>
<br>>>>>>
<br>>>>>> Output of R CMD javareconf
<br>>>>>>
<br>>>>>> [.../~]: R CMD javareconf -n
<br>>>>>> Java interpreter : /usr/bin/java
<br>>>>>> Java version : 1.8.0_25
<br>>>>>> Java home path : /Library/Java/<wbr>JavaVirtualMachines/jdk1.8.0_<wbr>25.jdk/Contents/Home/jre
<br>>>>>> Java compiler : /usr/bin/javac
<br>>>>>> Java headers gen.: /usr/bin/javah
<br>>>>>> Java archive tool: /usr/bin/jar
<br>>>>>> Non-system Java on OS X
<br>>>>>>
<br>>>>>> trying to compile and link a JNI program
<br>>>>>> detected JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/<wbr>darwin
<br>>>>>> detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
<br>>>>>> clang -I/Library/Frameworks/R.<wbr>framework/Resources/include -DNDEBUG -I/Library/Java/<wbr>JavaVirtualMachines/jdk1.8.0_<wbr>25.jdk/Contents/Home/jre/../<wbr>include -I/Library/Java/<wbr>JavaVirtualMachines/jdk1.8.0_<wbr>25.jdk/Contents/Home/jre/../<wbr>include/darwin -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -fPIC -Wall -mtune=core2 -g -O2 -c conftest.c -o conftest.o
<br>>>>>> clang -dynamiclib -Wl,-headerpad_max_install_<wbr>names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.<wbr>framework/Resources/lib -L/usr/local/lib -o conftest.so conftest.o -L/Library/Java/<wbr>JavaVirtualMachines/jdk1.8.0_<wbr>25.jdk/Contents/Home/jre/lib/<wbr>server -ljvm -F/Library/Frameworks/R.<wbr>framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
<br>>>>>>
<br>>>>>> JAVA_HOME : /Library/Java/<wbr>JavaVirtualMachines/jdk1.8.0_<wbr>25.jdk/Contents/Home/jre
<br>>>>>> Java library path: $(JAVA_HOME)/lib/server
<br>>>>>> JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/<wbr>darwin
<br>>>>>> JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
<br>>>>>>
<br>>>>>> ______________________________<wbr>_________________
<br>>>>>> R-SIG-Mac mailing list
<br>>>>>> <a href="javascript:" target="_blank" gdf-obfuscated-mailto="juKFkuO7AAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">R-SI...@r-project.org</a>
<br>>>>>> <a href="https://stat.ethz.ch/mailman/listinfo/r-sig-mac" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-mac\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkqAlfGt1yZw-XSwiexZHN9YXtYA';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-mac\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkqAlfGt1yZw-XSwiexZHN9YXtYA';return true;">https://stat.ethz.ch/mailman/<wbr>listinfo/r-sig-mac</a>
<br>>>>>>
<br>>>>>
<br>>>>>
<br>>>>> --
<br>>>>> Brian D. Ripley, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="juKFkuO7AAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">rip...@stats.ox.ac.uk</a>
<br>>>>> Emeritus Professor of Applied Statistics, University of Oxford
<br>>>>
<br>>>
<br>>>
<br>>> --
<br>>> Brian D. Ripley, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="juKFkuO7AAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">rip...@stats.ox.ac.uk</a>
<br>>> Emeritus Professor of Applied Statistics, University of Oxford
<br>>
<br>> ______________________________<wbr>_________________
<br>> R-SIG-Mac mailing list
<br>> <a href="javascript:" target="_blank" gdf-obfuscated-mailto="juKFkuO7AAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">R-SI...@r-project.org</a>
<br>> <a href="https://stat.ethz.ch/mailman/listinfo/r-sig-mac" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-mac\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkqAlfGt1yZw-XSwiexZHN9YXtYA';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-mac\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkqAlfGt1yZw-XSwiexZHN9YXtYA';return true;">https://stat.ethz.ch/mailman/<wbr>listinfo/r-sig-mac</a>
<br>>
<br>
<br>______________________________<wbr>_________________
<br>R-SIG-Mac mailing list
<br><a href="javascript:" target="_blank" gdf-obfuscated-mailto="juKFkuO7AAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">R-SI...@r-project.org</a>
<br><a href="https://stat.ethz.ch/mailman/listinfo/r-sig-mac" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-mac\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkqAlfGt1yZw-XSwiexZHN9YXtYA';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-mac\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkqAlfGt1yZw-XSwiexZHN9YXtYA';return true;">https://stat.ethz.ch/mailman/<wbr>listinfo/r-sig-mac</a>
<br></blockquote></div></div></div></div></div>