rJava load error in RStudio/R after “upgrading” to OSX Yosemite

前端 未结 18 2105
Happy的楠姐
Happy的楠姐 2020-11-22 04:23

I recently \"upgraded\" from OSX Mountain Lion to Yosemite and from R 3.1.3 to 3.2. Immediately after the upgrade, when I opened R or RStudio I got a pop-up message saying t

18条回答
  •  故里飘歌
    2020-11-22 05:15

    Following command works:

    sudo ln -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
    

    After that, in RStudio, loading rJava works through loading of the "xlsx" package.

    library("xlsx")
    

    P.S. #1 Environment: Mac OS X El Capitan 10.11.3+ with RStudio 0.99.491+ and R 3.2.3+. (I've now tested this also on macOS Sierra (10.12) and R.3.3.1.)

    P.S. #2 I find that openxlsx is much faster and doesn't rely on Java to work, so I'm now using that package. Hope that helps others.

提交回复
热议问题