> registerDoSNOW(makeCluster(4, type="SOCK")) Loading required package: methods Loading required package: DBI Loading required
> package: rJava Error: package or namespace load failed for ‘rJava’:
> .onLoad failed in loadNamespace() for 'rJava', details: call:
> dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared
> object
> '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so':
> dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so,
> 6): Library not loaded: @rpath/libjvm.dylib Referenced from:
> /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so
> Reason: image not found Error: package ‘rJava’ could not be loaded
> Execution halted
This also happens if I try to use Knitr. So it is not related to registerDoSNOW() but to rJava and some kind of wrong pathing.
I've researched the common solutions (e.g., rJava load error in RStudio/R after "upgrading" to OSX Yosemite) to rJava not loading.
1) My Java is 64 bit version
2) library(rJava)
loads fine
3) It's only when I try to use registerDoSNOW(makeCluster(4, type="SOCK"))
This only started happening after I upgraded to R 3.4.2 from 3.3. I upgraded because data.table
complained that it could not make use of 64 bit architecture. When I upgraded, RStudio wouldn't run Java, which I fixed by executing sudo ln -f -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
I tried the solutions here http://paulklemm.com/blog/2015-02-20-run-rjava-with-rstudio-under-osx-10-dot-10/ with no avail.
java version "1.8.0_101" Java(TM) SE Runtime Environment (build 1.8.0_101-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)