我想使用rJava库与sc进行scala对话。不幸的是,在类路径中找不到JRI库。但是在我的sbt构建中,它直接包含在子目录中。
我的设置有什么问题? 可以在此处找到最小的示例:https://github.com/geoHeil/scalaRcran-rJava
执行sbt run
会抛出错误
我的设置:
通过sbt设置-Djava.library.path=externalLib/jri
似乎根本没有效果。通过intelliJ设置此选项会导致不同的错误:
# 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
运行运行脚本,示例在/Library/Frameworks/R.framework/Resources/library/rJava/jri
文件夹中运行正常。