title: .onLoad failed in loadNamespace() for 'rJava' when installing a package
body: <p>I have a package "javaOnLoadFailed" (just a minimal package for testing my issue, hence the weird name) which imports rJava. I get 'rJava' errors when I try to either check() or install() the package, even though require(rJava) itself works fine. </p>
  
  <p>install() gives the following errors:</p>
  
  <pre><code>&gt; install()
  Installing javaOnloadFailed
  "C:/Program Files/R/R-3.2.0/bin/x64/R" --no-site-file --no-environ --no-save  \
  --no-restore CMD INSTALL  \
  "C:/Projects/stackoverflow/javaOnloadFailed/javaOnLoadFailed"  \
  --library="C:/Users/adb2018/Documents/R/win-library/3.2" --with-keep.source  \
  --install-tests 
  
  * installing *source* package 'javaOnloadFailed' ...
  ** R
  ** preparing package for lazy loading
  ** help
  *** installing help indices
  ** building package indices
  ** testing if installed package can be loaded
  *** arch - i386
  Error : .onLoad failed in loadNamespace() for 'rJava', details:
    call: inDL(x, as.logical(local), as.logical(now), ...)
    error: unable to load shared object 'C:/Users/adb2018/Documents/R/win-library/3.2/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/adb2018/Documents/R/win-library/3.2/javaOnloadFailed'
  Error: Command failed (1)
  </code></pre>
  
  <p>I am using R 3.2.0 from within Architect, with sessionInfo():</p>
  
  <pre><code>R version 3.2.0 (2015-04-16)
  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 
  [2] LC_CTYPE=English_United States.1252   
  [3] LC_MONETARY=English_United States.1252
  [4] LC_NUMERIC=C                          
  [5] LC_TIME=English_United States.1252    
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] devtools_1.7.0.9000 rj_2.0.3-2         
  
  loaded via a namespace (and not attached):
  [1] tools_3.2.0   rj.gd_2.0.0-1
  </code></pre>