0

I cannot install the package on my Windows 10 64-bit PC. I've got the latest version of R installed which was required to install RJDBC and rJava is loading and running without any issue on all the other packages I use with a dependency to it. Below are the results of running a few checks:

> sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 

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     

loaded via a namespace (and not attached):
[1] compiler_3.6.2  tools_3.6.2     mongolite_2.1.0 jsonlite_1.6.1

> Sys.getenv("JAVA_HOME")
[1] "C:\\Program Files\\Java\\jdk-13.0.2"

> library(rJava)
> .jinit()
> .jcall("java/lang/System", "S", "getProperty", "java.runtime.version")
[1] "13.0.2+8"

However when I try to install the package, it fails as follows:

> devtools::install_github("snowflakedb/dplyr-snowflakedb")
Downloading GitHub repo snowflakedb/dplyr-snowflakedb@master
√  checking for file 'C:\Users\xxxx\AppData\Local\Temp\RtmpWkzKSM\remotes326067c2358a\snowflakedb-dplyr-snowflakedb-a4299ad/DESCRIPTION' ...
-  preparing 'dplyr.snowflakedb':
√  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  building 'dplyr.snowflakedb_0.3.0.tar.gz'

Installing package into ‘C:/Users/xxxx/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'dplyr.snowflakedb' ...
** using staged installation
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'dplyr.snowflakedb'
    finding HTML links ... done
    SnowflakeDBConnection-class             html  
    db_snowflake_copy                       html  
    dplyr.snowflakedb                       html  
    lahman                                  html  
    lahman_snowflakedb                      html  
** building package indices
** testing if installed package can be loaded from temporary location
*** arch - i386
Error: package or namespace load failed for 'rJava':
 .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/R/win-library/3.6/rJava/libs/i386/rJava.dll':
  LoadLibrary failure:  %1 is not a valid Win32 application.

Error : package 'rJava' could not be loaded
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Users/xxxx/R/win-library/3.6/dplyr.snowflakedb'
Error: Failed to install 'dplyr.snowflakedb' from GitHub:
  (converted from warning) installation of package ‘C:/Users/xxxx/AppData/Local/Temp/RtmpWkzKSM/file326067fe7d41/dplyr.snowflakedb_0.3.0.tar.gz’ had non-zero exit status

Does the package only work if you have a 32-bit version of JDK installed? I was however told that you cannot run rJava with a 32-bit installation of Java if you're running a 64-bit version of R.

  • I think you have to use the same bitness for both R and the JDK. Have you tested both 32-bit across the installations and 64-bit? I see some threads on this general error: https://stackoverflow.com/questions/7019912/using-the-rjava-package-on-win7-64-bit-with-r – Suzy Lockwood Feb 12 '20 at 00:11
  • It looks like there was a similar issue opened in the git repository here: https://github.com/snowflakedb/dplyr-snowflakedb/issues/30 a closed issue that is similar to yours was solved with the answer they provided here: https://github.com/snowflakedb/dplyr-snowflakedb/issues/1 – Rachel McGuigan Feb 12 '20 at 01:41
  • @SuzyLockwood thank you but the issue is not with rJava but with this particular package. All my other packages and own work are done on 64-bit version of R and JDK so I'm reluctant to uninstall them just to be able to use this package. – Gyombon Feb 13 '20 at 14:51
  • @RachelMcGuigan thank you but I do not have a 32-bit version of R installed in my machine so it is a different issue. – Gyombon Feb 13 '20 at 14:53
  • @Gyombon I understand. Would you be able to test on another machine? If you can get it working on another machine, then at least you know where the problem lies on your main machine before you have to consider uninstalling anything. – Suzy Lockwood Feb 13 '20 at 20:14
  • The build appears to try and use `i386` architecture which appears to be the potential cause. For Windows, the architecture string is sourced from a platform function: `.Platform$r_arch`. Can you share the output of that? – Harsh J Feb 15 '20 at 21:51
  • @Harsh The output is "x64" which is what doesn't make sense to me. – Gyombon Feb 17 '20 at 08:17

0 Answers0