rJava installation fails on macOS 10.14

前端 未结 4 1853
天涯浪人
天涯浪人 2020-12-19 20:31

After upgrading to MacOS Mojave (10.14.1), I\'m no longer able to install rJava for R version 3.5.1 with Java version \"1.8.0_102\" installed.

I tried

4条回答
  •  甜味超标
    2020-12-19 21:17

    Posting the solution I found in case it helps others -- I don't quite understand why this work or if it's the right way so looking for better alternatives!

    This issue lead to this Apple forum where it's stated

    For legacy software that looks for the macOS headers in the base system under /usr/include, please install the package file located at: /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14. pkg

    To do this, open terminal and run these commands

    cd /Library/Developer/CommandLineTools/Packages/
    open macOS_SDK_headers_for_macOS_10.14.pkg
    

    then follow prompts to install the package.

    After this, in the terminal, configure rJava and install as in the previous answer

    sudo R CMD javareconf

    R -e "install.packages('rJava')"

    and it should install without problem.

提交回复
热议问题