0

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.

Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
  • I don't see the error message as supporting the assertion that `rJava` is not found. It says the `JRI library` was not found. Those are not the same things. I see nothing regarding the presence or absence or possible location of the rJava _package_. (There might be an `rJava` subdirectory that hold an rJava package, but there is no "rJava library". – IRTFM May 03 '16 at 06:46
  • But in the build.sbt file it was imported. And intelliJ shows no linting errors. – Georg Heiler May 03 '16 at 06:48
  • We seem to be talking at cross purposes. Your comment did not address any of the concerns I raised. – IRTFM May 03 '16 at 06:49
  • Ok sorry for that I meant JRI and not rjava. – Georg Heiler May 03 '16 at 06:51
  • Maybe you should remove the `[r]`and `[rjava]` tags? – IRTFM May 03 '16 at 06:52
  • Ok will do that. But thought that this was connected – Georg Heiler May 03 '16 at 06:52
  • Hard to say what is "connected" or not. You have provided precious little information about even your operating system, much less the specific versions of the various programs you were hoping to connect or hte manner in which they might have been installed. – IRTFM May 03 '16 at 06:55
  • Sure it is osx. I want to connect current versions of these libraries . These were taken of the current rjava from cran – Georg Heiler May 03 '16 at 06:56
  • Sigh. I also use OSX, but when I post questions I also post the versions of my OS _and_ R _and_ Java _and_ my JDK. And when I need to add further information ... I USE THE EDIT FEATURE OF THE STACKOVERFLOW INTERFACE. – IRTFM May 03 '16 at 06:59
  • sorry for that. was on my mobile phone. But now I could update the post properly – Georg Heiler May 03 '16 at 07:09
  • I still see nothing to do with R. – IRTFM May 03 '16 at 07:17
  • I deleted the R tag. – Georg Heiler May 03 '16 at 07:51
  • @42: https://www.rforge.net/JRI/ according to their documentation JRI and rJava have merged./ JRI is included in rJava. That's why I initially included it in the keywords. – Georg Heiler May 04 '16 at 21:15
  • My reading of the documentation is that rJava was built against Java 1.6. You can get the email of the maintainer of rJava with `maintainer('rJava") although I will be surprised if it's not Simon Urbanek who also maintains the OSX fork of R. If you contact him be sure to give him the output of sessionInfo() from an R session prompt as well as all of this information. (To me it still looks as though this is a scala configuration problem.) – IRTFM May 04 '16 at 23:42
  • Thanks for the hint I will do that. I am very sure it is indeed a configuration problem as the ./run examples work. But so far I could not get it to wor in any other folder. According to http://conjugateprior.org/2014/12/r-java8-osx/ 1.8 should work just fine – Georg Heiler May 05 '16 at 07:39

0 Answers0