Problem loading rJava

Viewed 29989

Yesterday I removed R2.11 from my system (Win7, 64bit), since I´m working on R2.13.

Since then i get an error message:

> require(rJava)
Lade nötiges Paket: rJava
Error : .onLoad in loadNamespace() fehlgechlagen, Details:
  Aufruf: rJava
  Fehler: inDL(x, as.logical(local), as.logical(now), ...)

I tried specifying PATH, since I found on the internet that it might have something to do with jvm.dll:

c:\Rtools\bin;
c:\Rtools\perl\bin;
c:\Rtools\MinGW\bin;
c:\Rtools\MinGW64\bin;
C:\Windows\system32;
%R_HOME%\bin;
C:\Program Files\R\R-2.13.0\bin; 
C:\Program Files\Java\jre6\bin\server

However I could not solve the problem... I also can´t run R from the win command line (just type "R"?)

Any suggestions?

8 Answers

This may be due to a conflict between RStudio and Java versions. If you have installed 64 bit java and RStudio is running in 32 bit mode, you may experience problems like this. As a solution, you can change the 32-64 bit selection in the Tools-> Global Options-> General section in RStudio. You can find detailed information here.

I solved it by following these steps

  • setting my environment Sys.setenv(JAVA_HOME='C:\\Program Files (x86)\\Java\\jre6')
  • Manually installing rJava package from install package (even this should work: install.packages('rJava', .libPaths()[1], 'http://www.rforge.net/'))
  • library(rJava)

I solved this problem as follows. I've been trying for 2 days. Windows 7 users do not write ... \ bin \ x64 in environment variables. Instead, define the path as follows. JAVA_HOME "C: \ Program Files \ Java \ jre1.8.0_251" R_HOME C: \ Program Files \ R \ R-3.5.3

Related