RStudio keeps crashing while trying to initialise rJava library using .jinit command on Mac OS Catalina

Hi, I've been trying to install the rJava package on Mac OS Catalina (Version 10.15.3) using the Discourse Network Anaysis (DNA) manual, but it keep saying unable to load with the reason: image not found.

After much research, I fixed this by using Homebrew and was able to install the rJava library. Unfortunately, when I try to intialize it by using the .jinit command, Rstudio pops an abort session message.

The only thing I did differently from the manual was download the newest version of Java (jdk-8u241-macosx-x64.dmg) from here (https://www.oracle.com/java/technologies/javase-jdk8-downloads.html), instead of jdk-8u161-macosx-x64.dmg (as specified in the manual). Unsure if that makes a difference?I've attached screenshot below, please help on how to resolve this!

I am new to coding and network analysis and have some basic knowledge of R, I am trying use the DNA[Screenshot of error message on RStudio] tool for my PhD project and would be grateful if you could help me with the installation, thank you. I've attached a screenshot of the error message below for your reference.

Hi, and welcome!

Please see the FAQ: What's a reproducible example (`reprex`) and how do I create one? Using a reprex, complete with representative data will attract quicker and more answers.

In this case, I see the problem, but screenshots are not the best way.

The problem in the error message shows that the Java Virtual Machine didn't load. The reason is given in the jinit{rjava} manual page

Starting with version 0.5 rJava provides a custom class loader that can automatically track classes and native libraries that are provided in R packages. Therefore R packages should NOT use .jinit, but call .jpackage instead. In addition this allows the use of class path modifying function .jaddClassPath.

So, try with .jpackage

Hi technocrat, thank you so much. This let me move forward and install rDNA packages from github. However, R starts aborting everytime I try to initilalize DNA to download the .jar file. Screenshot attached below for your reference, any suggestions on how to move forward? Thank you!

p.s. I tried to do a reprex but wasn't able to do it successfully, sorry! I hope the screenshots aren't too much trouble

Screen Shot 2020-03-08 at 3.42.51 PM

1 Like

I should have been clearer: a reprex is very helpful for coding questions. But if a program crashes the program, you'll never be able to produce one!

What happens when you run the same two lines in the R GUI console outside of RStudio?

I am assuming you meant just in R? the library(rDNA) command worked but when I typed dna_init(), the R app just disappeared. So I think it must have crashed?

Right. That means it's not a problem in RStudio. I'll see what else I can find.

Memory refreshed. After High Sierra, Apple did some OS level locking down of what programs could run "unsandboxed."

See stan's answer in S/O I haven't been brave enough to try this myself.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.