R Studio正在安装xlsx包

  • 本文关键字:xlsx 安装 Studio r
  • 更新时间 :
  • 英文 :


我正试图使用R Studio安装xlsx包,但遇到了一些问题。当安装过程开始时,我被问到一个问题"只有源代码形式的程序包,可能需要编译C/C++/Frank:'rJava'。你想尝试从源代码安装这些程序包吗?"我回答"是"。

然后程序继续下载3.tar.gz文件。我已经复制了下面的完整代码。

问题是,我不确定下一步需要做什么才能完成安装?非常感谢您的帮助。

> install.packages("xlsx")
also installing the dependencies ‘rJava’, ‘xlsxjars’
Package which is only available in source form, and may need compilation of                C/C++/Fortran:
‘rJava’
Do you want to attempt to install these from sources?
y/n: y
installing the source packages ‘rJava’, ‘xlsxjars’, ‘xlsx’
trying URL 'https://cran.rstudio.com/src/contrib/rJava_0.9-7.tar.gz'
Content type 'application/x-gzip' length 711181 bytes (694 KB)
downloaded 694 KB
trying URL 'https://cran.rstudio.com/src/contrib/xlsxjars_0.6.1.tar.gz'
Content type 'application/x-gzip' length 9477071 bytes (9.0 MB)
downloaded 9.0 MB
trying URL 'https://cran.rstudio.com/src/contrib/xlsx_0.5.7.tar.gz'
Content type 'application/x-gzip' length 312839 bytes (305 KB)
downloaded 305 KB
* installing *source* package 'rJava' ...
** package 'rJava' successfully unpacked and MD5 sums checked
Generate Windows-specific files (src/jvm-w32) ...
make: Entering directory        `/cygdrive/c/Users/davish/AppData/Local/Temp/RtmpmOuT4w/R.INSTALL456448961b13/rJ    ava/src/jvm-w32'
dlltool --as as -m i386:x86-64 --as-flags --64 --input-def jvm64.def --kill-     at --dllname jvm.dll --output-lib libjvm.dll.a
gcc -m64 -O2 -c -o findjava.o findjava.c
gcc -m64 -s -o findjava.exe findjava.o
make: Leaving directory    `/cygdrive/c/Users/davish/AppData/Local/Temp/RtmpmOuT4w/R.INSTALL456448961b13/rJ    ava/src/jvm-w32'
Find Java...
ERROR*> JavaSoft{JRE|JDK} can't open registry keys.
ERROR: cannot find Java Development Kit.
   Please set JAVA_HOME to specify its location manually
Warning: running command 'sh ./configure.win' had status 1
ERROR: configuration failed for package 'rJava'
* removing 'C:/Program Files/R/R-3.2.2/library/rJava'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" CMD INSTALL -l      "C:Program FilesRR-3.2.2library"      C:UsersdavishAppDataLocalTempRtmp2FwjgL/downloaded_packages/rJava_0.9-    7.tar.gz' had status 1
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
ERROR: dependency 'rJava' is not available for package 'xlsxjars'
* removing 'C:/Program Files/R/R-3.2.2/library/xlsxjars'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" CMD INSTALL -l    "C:Program FilesRR-3.2.2library"    C:UsersdavishAppDataLocalTempRtmp2FwjgL/downloaded_packages/xlsxjars_0.6.1 .tar.gz' had status 1
Warning in install.packages :
installation of package ‘xlsxjars’ had non-zero exit status
ERROR: dependencies 'rJava', 'xlsxjars' are not available for package 'xlsx'
* removing 'C:/Program Files/R/R-3.2.2/library/xlsx'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" CMD INSTALL -l   "C:Program FilesRR-3.2.2library"   C:UsersdavishAppDataLocalTempRtmp2FwjgL/downloaded_packages/xlsx_0.5.7.tar    .gz' had status 1
Warning in install.packages :
installation of package ‘xlsx’ had non-zero exit status
The downloaded source packages are in
‘C:UsersdavishAppDataLocalTempRtmp2FwjgLdownloaded_packages’

请查看错误:

ERROR*> JavaSoft{JRE|JDK} can't open registry keys.
ERROR: cannot find Java Development Kit.
   Please set JAVA_HOME to specify its location manually

解决方案:安装jdk

最新更新