I want to make scala talk to R using the rJava library. Unfortunately, the JRI library is not found on the classpath. But in my sbt build it is included directly from a sub-directory.
What is wrong with my setup? A minimal example can be found here: https://github.com/geoHeil/scalaRcran-rJava
executing a sbt run
will throw the error
My Setup:
- osx 10.11.4, java8 (in particular
- java version "1.8.0_74" Java(TM) SE Runtime Environment (build 1.8.0_74-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode) ), Scala 2.11.8, R 3.2.4 and the current rJava library from CRAN
setting the -Djava.library.path=externalLib/jri
via sbt seems to have no effect at all. Setting this option via intelliJ results in a different error:
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000012525cf42, pid=35822, tid=5891
#
# JRE version: Java(TM) SE Runtime Environment (8.0_74-b02) (build 1.8.0_74-b02)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.74-b02 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C [libR.dylib+0x134f42] GetNewPage+0x1a2
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/geoHeil/Downloads/rjaav/hs_err_pid35822.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Process finished with exit code 134
edit
running the run script and the examples works just fine in the /Library/Frameworks/R.framework/Resources/library/rJava/jri
folder.