Home >Java >javaTutorial >Why Does rJava Fail to Load in RStudio After an OSX Yosemite Upgrade, and How Can I Fix It?
Following an upgrade to OSX Yosemite and R 3.2, loading rJava or its dependent packages triggers an error in RStudio. Opening R from the command line, however, resolves the issue.
The error stems from RStudio's incorrect Java path, resulting in the failure to locate the 'libjvm.dylib' library during the rJava loading process.
Various fixes were attempted:
To resolve the issue, link 'libjvm.dylib' to '/usr/local/lib':
sudo ln -f -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
This allows RStudio to locate 'libjvm.dylib' during rJava loading, thereby resolving the error.
The above is the detailed content of Why Does rJava Fail to Load in RStudio After an OSX Yosemite Upgrade, and How Can I Fix It?. For more information, please follow other related articles on the PHP Chinese website!