1

I need rJava to manage structured NetLogo model experiments directly within the R environment. Until recently, I was perfectly able to conduct my experiments using jdk-9.0.4 and R 3.4.0 on OSX El Capitan 10.11.6. The trick was to apply the instructions found in

https://github.com/MTFA/CohortEx/wiki/Run-rJava-with-RStudio-under-OSX-10.10,-10.11-(El-Capitan)-or-10.12-(Sierra)

together with the explicit loading of the filelibjvm.dylibas described here.

After an upgrade to jdk-10.0.1 and R 3.5.0, however, things have gone bad. I am still able to load rJava, but running even the simplest code results in the following error:

dyn.load('//Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/lib/server/libjvm.dylib')
library(rJava)
.jinit(); .jcall( 'java/lang/System', 'S', 'getProperty', 'java.home' )
[1] "/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre"
f <- .jnew("java/awt/Frame","Hello")
Error in .jnew("java/awt/Frame", "Hello") : java.awt.HeadlessException
2018-05-20 02:40:02.820 R[6359:112701] [JRSAppKitAWT markAppIsDaemon]: Process manager already initialized: can't fully enable headless mode.

I have searched everywhere for a solution, but the problem persists no matter what I do. I also have tried to remove all relevant components from my machine and repeat the above rJava installation instructions using jdk-8u171, jdk-9.0.4, and jdk-10.0.1, as well as rJava 0.9-8 and 0.9-9 along the way.

Any help on this issue would be most sincerely appreciated.

0 Answers0