简体   繁体   English

R Studio安装xlsx包

[英]R Studio installing xlsx package

I'm trying to install the xlsx package using R Studio but I am encountering some problems. 我正在尝试使用R Studio安装xlsx包,但我遇到了一些问题。 When the installation process starts I am asked the question "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?" 当安装过程开始时,我被问到“只能以源代码形式提供的包,可能需要编译C / C ++ / Fortran:'rJava'你想尝试从源代码安装吗?” to which I reply "y". 我回复“y”。

The program then goes on to download 3 .tar.gz files. 该程序然后继续下载3 .tar.gz文件。 I have copied the full code below. 我复制了下面的完整代码。

Problem is, I'm not sure what I need to do next in order to complete the installation? 问题是,我不确定下一步需要做什么才能完成安装? Any help is greatly appreciated. 任何帮助是极大的赞赏。

> 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 Files\R\R-3.2.2\library"      C:\Users\davish\AppData\Local\Temp\Rtmp2FwjgL/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 Files\R\R-3.2.2\library"    C:\Users\davish\AppData\Local\Temp\Rtmp2FwjgL/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 Files\R\R-3.2.2\library"   C:\Users\davish\AppData\Local\Temp\Rtmp2FwjgL/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:\Users\davish\AppData\Local\Temp\Rtmp2FwjgL\downloaded_packages’

Please see the error : 请看错误:

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

solution : install jdk 解决方案:安装jdk

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM