Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package or namespace load failed for ‘rJava’ #49

Closed
SandraDuenas opened this issue Jun 20, 2015 · 2 comments
Closed

package or namespace load failed for ‘rJava’ #49

SandraDuenas opened this issue Jun 20, 2015 · 2 comments

Comments

@SandraDuenas
Copy link

Hi,
I am trying to load the rJava package in R and get the error shown below.

Just a note: I have Windows 8.1, already installed Java SDK and Java for Windows 8 with update 45, installed R 2 and I'm using R Studio latest version. Updated the System path to include the bin directory where Java SDK was installed, tested it successfully via the Command prompt. Downloaded the latest package of rJava_0.9-7.zip and unzip the files in the R Working directory and in the win 3.2 directory that R goes to when it runs the library(rJava) command.

But nothing seems to work. If anyone has a solution to the issues below, please let me know at sandraduenas2013@u.northwestern.edu. Thank you!

install.packages("rJava")
Installing package into ‘C:/Users/Sandra/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/rJava_0.9-6.zip'
Content type 'application/zip' length 761928 bytes (744 KB)
downloaded 744 KB

package ‘rJava’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\Sandra\AppData\Local\Temp\RtmpkxFfsn\downloaded_packages

library(rJava)
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/Sandra/Documents/R/win-library/3.2/rJava/libs/x64/rJava.dll':
LoadLibrary failure: The specified module could not be found.

Error: package or namespace load failed for ‘rJava’

@SandraDuenas
Copy link
Author

I found the solution to this issue, it turned out that the automatic installation of Java 8 was being done into the folder C:\Program Files (x86)

I went ahead and uninstalled all Java from my laptop and then manually installed the Java 8 version into the C:\Program Files\ folder (which is for 64-bit, and then when I re-ran the install.packages and library for the RJDBC, it automatically installed the rJava package.

So, the issue was due to how the automatic (not manual) installation of Java 8 was originally done in my laptop, incorrect default folder for the install.

So, this issue is closed.

@s-u
Copy link
Owner

s-u commented Oct 21, 2015

This seems more like a common Java architecture mismatch - x86 target means 32-bit Java, but you're running 64-bit R. You must have the corresponding Java for your R (so 64-bit Java for 64-bit R).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants