ma c версия ОС: Catalina 10.15.6 / версия R: 4.0 / java версия: jdk1.8.0_261 /
В Rstudio
параметры (' java .home ') $ java .home [1] "/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/jre"
Когда я пытаюсь установите пакет «r Java», я получил это сообщение об ошибке ниже. Что делать?
> install.packages("rJava", type="source")
trying URL 'https://cran.rstudio.com/src/contrib/rJava_0.9-13.tar.gz'
Content type 'application/x-gzip' length 664898 bytes (649 KB)
==================================================
downloaded 649 KB
* installing *source* package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... /usr/local/Cellar/gcc/7.2.0/bin/gcc-7
checking whether the C compiler works... no
configure: error: in `/private/var/folders/mj/wsvhxpw97zg6bbkj8_l9ypq80000gn/T/RtmpRVS6dT/R.INSTALL3dd63d5ae141/rJava':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘rJava’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rJava’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rJava’
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/mj/wsvhxpw97zg6bbkj8_l9ypq80000gn/T/RtmpcJcDfr/downloaded_packages’
И в терминале при запуске sudo R CMD javareconf
я получил следующее:
Java interpreter : /Users/name/.jenv/shims/java
Java version : 1.8.0_261
Java home path : /Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/jre
Java compiler : /Users/name/.jenv/shims/javac
Java headers gen.: /Users/name/.jenv/shims/javah
Java archive tool: /Users/name/.jenv/shims/jar
trying to compile and link a JNI program
detected JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/darwin
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
/usr/local/Cellar/gcc/7.2.0/bin/gcc-7 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/jre/../include -I/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/jre/../include/darwin -I/usr/local/include -fPIC -Wall -g -O2 -c conftest.c -o conftest.o
/bin/sh: /usr/local/Cellar/gcc/7.2.0/bin/gcc-7: No such file or directory
make: *** [conftest.o] Error 127
Unable to compile a JNI program
JAVA_HOME : /Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/jre
Java library path:
JNI cpp flags :
JNI linker flags :
Updating Java configuration in /Library/Frameworks/R.framework/Resources
Done.