Unable to load rJava on R

后端 未结 8 2059
野趣味
野趣味 2020-11-27 05:14

I wish to load rJava in R x64 3.1.2. OS- Windows 8.1 64 bit

Though installation seems to work fine:

  > install.packages(\"rJava\")
    Installing         


        
8条回答
  •  清酒与你
    2020-11-27 05:26

    I got a similar error:

    > 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:/program files/R/R-3.1.2/library/rJava/libs/x64/rJava.dll':
      LoadLibrary failure:  The specified module could not be found.
    

    My JAVA_HOME was pointing to JDK, rather than JRE.

    > Sys.getenv("JAVA_HOME")
    [1] "c:\\java\\jdk1.7.0_55"
    > Sys.setenv(JAVA_HOME="c:\\java\\jdk1.7.0_55\\jre")
    

    I could now load rJava and xlsx in R.

提交回复
热议问题