[R-SIG-Mac] Issues with rJava on OS X El Capitan

Prof Brian Ripley ripley at stats.ox.ac.uk
Sun Feb 14 11:48:53 CET 2016


Your Java is seriously old.  Start by updating it (1.8.0_74 is current, 
AFAIK).

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/JavaVM.framework and not Oracle Java.


On 14/02/2016 09:22, Berend Hasselman wrote:
> I have installed rJava, xlsx, xlsxjars, XLConnect and XLConnectJars.
>
> Executing library(xlsx) gives this output
>
> Loading required package: rJava
> Loading required package: xlsxjars
> Error : .onLoad failed in loadNamespace() for 'xlsx', details:
>    call: .jinit()
>    error: JNI_GetCreatedJavaVMs returned -1
>
> Error: package or namespace load failed for 'xlsx'
> JavaVM: requested Java version ((null)) not available. Using Java at "" instead.
> JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
> JavaVM FATAL: Failed to load the jvm library.
>
>
> Executing library(XLConnect) gives this output
>
> Loading required package: XLConnectJars
> Error : .onLoad failed in loadNamespace() for 'XLConnectJars', details:
>    call: .jinit()
>    error: JNI_GetCreatedJavaVMs returned -1
>
> Error: package 'XLConnectJars' could not be loaded
> JavaVM: requested Java version ((null)) not available. Using Java at "" instead.
> JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
> JavaVM FATAL: Failed to load the jvm library.
>
>
> sessionInfo (after library(xlsx) and library(XLConnect)) and javareconf output below.
>
> What is going on?
> What is the solution for this problem?
>
> Berend Hasselman
>
>
> SessionInfo:
>
> R version 3.2.3 Patched (2016-02-13 r70160)
> Platform: x86_64-apple-darwin13.4.0 (64-bit)
> Running under: OS X 10.11.3 (El Capitan)
>
> locale:
> [1] en_IE.UTF-8/en_IE.UTF-8/en_IE.UTF-8/C/en_IE.UTF-8/en_IE.UTF-8
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] xlsxjars_0.6.1 rJava_0.9-8
>
> loaded via a namespace (and not attached):
> [1] tools_3.2.3
>
>
> Output of R CMD javareconf
>
> [.../~]: R CMD javareconf -n
> 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
>
> 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/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 -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -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/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
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford



More information about the R-SIG-Mac mailing list