.jinit() fails on Apple silicon with hardened run-time · Issue #267 · s-u/rJava (original) (raw)

Thank you so much for rJava! The new Apple M1 chip is great, yet it is a challenge... I am sure you have seen already that the current rJava release (v1.0-4) does not pass CRAN checks: https://cran.r-project.org/web/checks/check_results_rJava.html

On my local Mac mini the error I get is as follows

zsh: trace trap R

So the R session crashes entirely. I have tried with different versions of JDK (the Azul Zulu Builds), but the Java version does not make a difference.

Looking inside .jinit(), I can reconstruct this scenario for the R crash:

parameters <- getOption("java.parameters") boot.classpath <- file.path(rJava:::.rJava.base.path, "java", "boot") .External(rJava:::RinitJVM, boot.classpath, parameters)

I have also tried to install older versions of rJava, but the framework JavaVM is apparently missing from the latest versions of Xcode.