title: Error installing 'ReporteRs' and 'ReporteRsjars'
body: <p>Ultimately I am attempting to install the R package <code>ReporteRs</code> (<code>ReporteRs_0.8.7.tar.gz</code>) on a <strong>Windows 7</strong> system (session info, and other info below).  This depends on the package <code>ReporteRsjars</code> (<code>ReporteRsjars_0.0.2.tar.gz</code>) which is where I am getting the install error.</p>
  
  <p>This also depends on the R package <code>rJava</code> which is installed, along with JDK/JRE (jre1.8.0_112).</p>
  
  <p>I am installing on a machine that has no internet access so I am doing this from a local version of CRAN with the <code>PACKAGES</code> and <code>PACKAGES.gz</code> built. This has been working without any issues (at least now it is).</p>
  
  <p><code>rJava</code> loads without any issues but when installing <code>ReporteRsjars</code>, I get the error below (see <strong>Install Attempt ERROR</strong> below).</p>
  
  <p><strong>NOTE:</strong> Other StackOverflow questions seem more focussed around <code>library(rJava)</code> having issues, not when installing a package dependent on <code>rJava</code>.</p>
  
  <p><strong>The <code>rJava</code> DLL</strong> is in the following location:</p>
  
  <pre><code>C:/Program Files/R/R-3.3.2/library/rJava/libs/x64/rJava.dll
  </code></pre>
  
  <p>This was reinstalled a number of times (successfully).</p>
  
  <p>The <code>sessionInfo</code> and a more information is below the error (including what I tried).</p>
  
  <p><strong>Install Attempt ERROR</strong></p>
  
  <p><code>cran_dir_url</code> is set to the path where the CRAN packages are located.  This is prefixed with <code>file://</code></p>
  
  <pre><code>&gt; library(rJava)
  &gt; 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
  ## 
  </code></pre>
  
  <p><strong>Environment Information &amp; Tools</strong></p>
  
  <p><strong>Path Info:</strong>  The following is included in the system path and is where Java was installed.</p>
  
  <pre><code>C:\Program Files\Java\jre1.8.0_112\bin\;C:\Program Files\Java\jre1.8.0_112\bin\server\;%path%
  </code></pre>
  
  <p>(JDK Installer: jdk-8u112-windows-x64)</p>
  
  <p><strong>Rtools Version and Location</strong></p>
  
  <p>Version:  3.4.0.1962
  Location: <code>C:\Rtools</code></p>
  
  <p><strong>What I Tried</strong></p>
  
  <ul>
  <li><p>I started with attempting to install the <code>ReporteRs</code> R packages, and this installed all dependencies but failed on the <code>ReporteRsjars</code> package.</p></li>
  <li><p>After installing the JDK/JRE, I reinstalled <code>rJava</code> (this was done a few times after various attempts to install the R package). All <code>rJava</code> installs were successful, and so was <code>library(rJava)</code>.</p></li>
  <li><p>I attempted to run the following command in a windows command window, as I have seen this recommended in a number of SO answers.</p>
  
  <blockquote>
    <p>R CMD javareconf</p>
    
    <h2>'javareconf' is not recognized as an internal or external command, operable program or batch file.</h2>
  </blockquote></li>
  <li><p>I attempted to include the path to the <code>rJava</code> DLL in the <code>path</code> system variable but that did not work.</p></li>
  <li><p>NOTE: I restarted the RGui and RStudio after each of these attempts (I tried in both of these environments). I also rebooted the machine.</p></li>
  <li><p>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.</p></li>
  </ul>
  
  <p>An guidance to help me troubleshoot and solve this would be appreciated.</p>
  
  <p><strong>Session Info</strong></p>
  
  <pre><code>&gt; sessionInfo('rJava')
  ## 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
  ## 
  ## locale:
  ## [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
  ## [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
  ## [5] LC_TIME=English_United States.1252    
  ## 
  ## attached base packages:
  ## character(0)
  ## 
  ## other attached packages:
  ## [1] rJava_0.9-8
  ## 
  ## loaded via a namespace (and not attached):
  ## [1] graphics_3.3.2  tools_3.3.2     utils_3.3.2     grDevices_3.3.2 stats_3.3.2     datasets_3.3.2 
  ## [7] methods_3.3.2   base_3.3.2     
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>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:</p>
  
  <pre><code>...
  *** 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
  ...
  </code></pre>
  
  <p>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.</p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>Note: this is not posted as an answer since it is just a workaround.</p>
  
  <p>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 <code>.zip</code> versions of the libraries and not the <code>tar.gz</code>; I am not sure if that matters.</p>
  
  <p><strong>EDIT 3</strong></p>
  
  <p>Based on the response from David Gohel in the this <a href="https://github.com/davidgohel/ReporteRs/issues/152" rel="nofollow noreferrer">ReporteRs Issues</a>, the following code with the <code>INSTALL_opts = "--no-multiarch"</code> added may fix the issue:</p>
  
  <pre><code>install.packages("ReporteRs", contriburl=cran_dir_url,
                   repos = cran_dir_url, 
                   type = 'source', INSTALL_opts = "--no-multiarch")
  </code></pre>
  
  <p>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 <strong>EDIT 2</strong>.</p>