Ultimately I am attempting to install the R package
) on a Windows 7
system (session info, and other info below). This depends on the package
) which is where I am getting the install error.
This also depends on the R package
which is installed, along with JDK/JRE (jre1.8.0_112).
I am installing on a machine that has no internet access so I am doing this from a local version of CRAN with the
built. This has been working without any issues (at least now it is).
loads without any issues but when installing
, I get the error below (see Install Attempt ERROR
Other StackOverflow questions seem more focussed around
having issues, not when installing a package dependent on
is in the following location:
This was reinstalled a number of times (successfully).
and a more information is below the error (including what I tried).
Install Attempt ERROR
is set to the path where the CRAN packages are located. This is prefixed with
Environment Information & Tools
> install.packages('ReporteRsjars', contriburl=cran_dir_url, repos = cran_dir_url, type = 'source')
## * installing *source* package 'ReporteRsjars' ...
## ** package 'ReporteRsjars' successfully unpacked and MD5 sums checked
## ** R
## ** inst
## ** preparing package for lazy loading
## ** help
## No man pages found in package 'ReporteRsjars'
## *** installing help indices
## ** building package indices
## ** testing if installed package can be loaded
## *** arch - i386
## Error : .onLoad failed in loadNamespace() for 'rJava', details:
## call: library.dynam("rJava", pkgname, libname)
## error: DLL 'rJava' not found: maybe not installed for this architecture?
## Error: loading failed
## Execution halted
## *** arch - x64
## ERROR: loading failed for 'i386'
## * removing 'C:/Program Files/R/R-3.3.2/library/ReporteRsjars'
## Warning in install.packages :
## running command '"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.2\library" /Users/cirina_ext/Documents/StevenBanville/CRAN_Targeted/ReporteRsjars_0.0.2.tar.gz' had status 1
## Warning in install.packages :
## installation of package 'ReporteRsjars' had non-zero exit status
The following is included in the system path and is where Java was installed.
C:\Program Files\Java\jre1.8.0_112\bin\;C:\Program Files\Java\jre1.8.0_112\bin\server\;%path%
(JDK Installer: jdk-8u112-windows-x64)
Rtools Version and Location
What I Tried
- I started with attempting to install the
R packages, and this installed all dependencies but failed on the
- After installing the JDK/JRE, I reinstalled
(this was done a few times after various attempts to install the R package). All
installs were successful, and so was
- I attempted to run the following command in a windows command window, as I have seen this recommended in a number of SO answers.
R CMD javareconf
'javareconf' is not recognized as an internal or external command, operable program or batch file.
- I attempted to include the path to the
DLL in the
system variable but that did not work.
- NOTE: I restarted the RGui and RStudio after each of these attempts (I tried in both of these environments). I also rebooted the machine.
- I have done a lot of googling and looking at StackOverflow but all of the issues have found are not the same as this. They appear similar but after attempting a number of things, I still get the above error. I have omitted the links I looked at but can add them if that would help.
An guidance to help me troubleshoot and solve this would be appreciated.
## R version 3.3.2 (2016-10-31)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 7 x64 (build 7601) Service Pack 1
##  LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
##  LC_MONETARY=English_United States.1252 LC_NUMERIC=C
##  LC_TIME=English_United States.1252
## attached base packages:
## other attached packages:
##  rJava_0.9-8
## loaded via a namespace (and not attached):
##  graphics_3.3.2 tools_3.3.2 utils_3.3.2 grDevices_3.3.2 stats_3.3.2 datasets_3.3.2
##  methods_3.3.2 base_3.3.2
I attempted the same install on a different machine with only the 64 bit version of Java (and confirmed it is 64 bit) and got the same error. Here is a snippet but it is the same as the above error:
*** arch - i386
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: library.dynam("rJava", pkgname, libname)
error: DLL 'rJava' not found: maybe not installed for this architecture?
Error: loading failed
I am still looking at the link from the comment by @42-, but this doesn't look like an issue with the JRE/JDK not being 64 bit.
Note: this is not posted as an answer since it is just a workaround.
I found a workaround which is not quite desirable. It seems the install from the local CRAN copy was not quite as similar as I had expected. I installed the problematic library install(s) on an equivalent Windows 7 machine using a NON-local CRAN (i.e. the usual way) and copied the directories to the other machine (i.e. the machine not connected to the internet). This appears to have worked but it is not clear why the other method did not (local CRAN copy with updated PACKAGES file). The one thing I noticed is, when hitting the usual CRAN repository, it used
versions of the libraries and not the
; I am not sure if that matters.
Based on the response from David Gohel in the this ReporteRs Issues
, the following code with the
INSTALL_opts = "--no-multiarch"
added may fix the issue:
repos = cran_dir_url,
type = 'source', INSTALL_opts = "--no-multiarch")
I will add this as an answer if I determine that it would fix the issue, however, I have already implemented the workaround mentioned in EDIT 2