rJava不加载

时间:2019-05-20 16:30:41

标签: r stanford-nlp rjava

我想从github站点安装CoreNLP软件包的版本,但是安装失败:

R version 3.6.0 (2019-04-26) -- "Planting of a Tree"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> Sys.setenv(JAVA_HOME = "C:\\Program Files\\Java\\jre1.8.0_211")
> Sys.getenv("JAVA_HOME")
[1] "C:\\Program Files\\Java\\jre1.8.0_211"
> # So that a version that can do sentiment analysis is used
> install.packages('devtools')
Installing package into ‘C:/Users/xxxx/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/devtools_2.0.2.zip'
Content type 'application/zip' length 387268 bytes (378 KB)
downloaded 378 KB

package ‘devtools’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\xxxx\AppData\Local\Temp\Rtmp6njo2R\downloaded_packages
> library(devtools)
> #withr::with_libpaths(new = "C:/Users/xxxx/Documents/R/win-library/3.6", install_github("statsmaths/coreNLP"))
> install_github("statsmaths/coreNLP")
Downloading GitHub repo statsmaths/coreNLP@master
√  checking for file 'C:\Users\xxxx\AppData\Local\Temp\Rtmp6njo2R\remotes1114791e35ed\statsmaths-coreNLP-caee22e/DESCRIPTION' (620ms)
-  preparing 'coreNLP':
√  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  looking to see if a 'data/datalist' file should be added
-  building 'coreNLP_0.4-3.tar.gz'

Installing package into ‘C:/Users/xxxx/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'coreNLP' ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'coreNLP'
    finding HTML links ... done
    annoEtranger.rda                        html  
    annoHp.rda                              html  
    annotateFile                            html  
    annotateString                          html  
    downloadCoreNLP                         html  
    getCoreference                          html  
    getDependency                           html  
    getOpenIE                               html  
    getParse                                html  
    getSentiment                            html  
    getToken                                html  
    initCoreNLP                             html  
    loadXMLAnnotation                       html  
    parseAnnoXML                            html  
    print.annotation                        html  
    universalTagset                         html  
** building package indices
** testing if installed package can be loaded from temporary location
*** arch - i386
Error: package or namespace load failed for 'coreNLP':
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: inDL(x, as.logical(local), as.logical(now), ...)
  error: unable to load shared object 'C:/Users/xxxx/Documents/R/win-library/3.6/rJava/libs/i386/rJava.dll':
  LoadLibrary failure:  %1 is not a valid Win32 application.

Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Users/xxxx/Documents/R/win-library/3.6/coreNLP'
Error in i.p(...) : 
  (converted from warning) installation of package ‘C:/Users/xxxx/AppData/Local/Temp/Rtmp6njo2R/file11143c015b22/coreNLP_0.4-3.tar.gz’ had non-zero exit status
> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] usethis_1.5.0  devtools_2.0.2

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1        ps_1.3.0          prettyunits_1.0.2 rprojroot_1.3-2   withr_2.1.2      
 [6] digest_0.6.18     crayon_1.3.4      assertthat_0.2.1  R6_2.4.0          backports_1.1.4  
[11] magrittr_1.5      rlang_0.3.4       cli_1.1.0         curl_3.3          fs_1.3.1         
[16] remotes_2.0.4     rstudioapi_0.10   callr_3.2.0       desc_1.2.0        tools_3.6.0      
[21] glue_1.3.1        pkgload_1.0.2     compiler_3.6.0    processx_3.3.1    pkgbuild_1.0.3   
[26] sessioninfo_1.1.1 memoise_1.1.0    

我不确定它在哪里或为什么找不到文件。我的想法是我的Windows是64位的,R是64位的,而Java是64位的,但是“某些”期望使用32位版本。但是我不知道如何解决这个问题。在Windows中,我删除并重新安装了Java 64位运行时几次。我还删除了rJava,devtools和coreNLP软件包并重新安装,但无济于事。

C:\Users\xxxx\Documents\R\win-library\3.6\rJava\libs\i386>dir
 Volume in drive C is WINDOWS 10 SD
 Volume Serial Number is A885-7323

 Directory of C:\Users\xxxx\Documents\R\win-library\3.6\rJava\libs\i386

18/05/2019  18:53    <DIR>          .
18/05/2019  18:53    <DIR>          ..
18/05/2019  18:53            74,766 rJava.dll
               1 File(s)         74,766 bytes
               2 Dir(s)  210,174,111,744 bytes free

C:\Users\xxxx\Documents\R\win-library\3.6\rJava\libs\i386>java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)

C:\Program Files\Java\jre1.8.0_211>dir
 Volume in drive C is WINDOWS 10 SD
 Volume Serial Number is A885-7323

 Directory of C:\Program Files\Java\jre1.8.0_211

17/05/2019  17:22    <DIR>          .
17/05/2019  17:22    <DIR>          ..
17/05/2019  17:22    <DIR>          bin
17/05/2019  17:22             3,244 COPYRIGHT
17/05/2019  17:22    <DIR>          lib
17/05/2019  17:22                44 LICENSE
17/05/2019  17:22                46 README.txt
17/05/2019  17:22               426 release
17/05/2019  17:22           112,748 THIRDPARTYLICENSEREADME-JAVAFX.txt
17/05/2019  17:22           149,725 THIRDPARTYLICENSEREADME.txt
17/05/2019  17:22               955 Welcome.html
               7 File(s)        267,188 bytes
               4 Dir(s)  210,171,428,864 bytes free

0 个答案:

没有答案