I'm trying to install rJava on a computer with Win 7 64 bit. When I run
install.packages("rJava") everything seems to be fine:
Installing package(s) into ‘C:/Users/djq/Documents/R/win-library/2.13’ (as ‘lib’ is unspecified) trying URL 'http://software.rc.fas.harvard.edu/mirrors/R/bin/windows/contrib/2.13/rJava_0.9-1.zip' Content type 'application/zip' length 654936 bytes (639 Kb) opened URL downloaded 639 Kb package 'rJava' successfully unpacked and MD5 sums checked The downloaded packages are in C:\TEMP\RtmpW2eAUw\downloaded_packages but when I tried to load the library library(rJava) I get the following error:
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/me/Documents/R/win-library/2.13/rJava/libs/x64/rJava.dll': LoadLibrary failure: %1 is not a valid Win32 application. Error: package/namespace load failed for 'rJava' I have installed the Java JRE (trying both 32 and 64 bit versions) and the JDK (using both 32 and 64 bit). My R version is R version 2.13.1 (2011-07-08) and I'm using RStudio.
If I try using 32 bit R, I can load rJava fine. Is the problem just that rJava does not run in R 64 bit? How can I tell if a package is just for 32 instead of 64?
edit: just posted R.version():
> R.Version() $platform [1] "x86_64-pc-mingw32" $arch [1] "x86_64" $os [1] "mingw32" $system [1] "x86_64, mingw32" $status [1] "" $major [1] "2" $minor [1] "13.1" $year [1] "2011" $month [1] "07" $day [1] "08" $`svn rev` [1] "56322" $language [1] "R" $version.string [1] "R version 2.13.1 (2011-07-08)" 
R.Version()to your question? I have just installed the 64bit version ofrJavausing the exact method you describe in your question. My guess is that your version of R is 32 bit.Program FilesorProgram Files (x86). Add path to windows as the accepted answer says. IfProgram Files (x86), it means you have 32-bit version, follow the link sites.google.com/site/rforfishandwildlifegrads/home/week_2/….