우선 R 버전을 sessionInfo()로 확인하고 여기서 최신버전 설치
최신 버전 설치 후 터미널에서
sudo R CMD javareconf
sudo R CMD javareconf
입력 후 JAVA_HOME Path 정보를 복사해두었다가
R에 아래 항목에 입력
Sys.setenv("JAVA_HOME" = '/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre')
dyn.load('/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre/lib/server/libjvm.dylib')
그럼에도 불구하고 아래와 같은 에러가 나면
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.6/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so
Reason: image not found
터미널에 아래와 같이 입력해주면 잘 됨
sudo ln -f -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
'코드와 오류 기록' 카테고리의 다른 글
[팀블로그 펌] WWDC2019 - iOS13 어떻게 달라지나? (0) | 2019.08.16 |
---|---|
swift Moya video upload (0) | 2019.07.24 |
cocoapods bad interpreter: No such file or directory 오류 해결 (0) | 2019.03.24 |
xcode bitbucket 수정 (0) | 2019.02.03 |
error: src refspec master does not match any. 해결방법 (2) | 2019.01.28 |