Cannot load rJava because cannot load a shared library

后端 未结 6 531
陌清茗
陌清茗 2020-12-31 13:53

I have been struggling to load the rJava package in R.

I get the following messages

> library(rJava)
Error in inDL(x, as.logical(local), as.logic         


        
6条回答
  •  灰色年华
    2020-12-31 14:40

    If you have read this threat and neither of the suggestions above has worked so far, then it might be worth trying one further:

    • Windows 7
    • R version 2.12.1 (2010-12-16) 64-bit
    • Java(TM) SE Runtime Environment (build 1.6.0_23-b05), Java HotSpot(TM) 64-Bit Server VM (build 19.0-b09, mixed mode)

      JAVA_HOME=C:\Program Files\Java\jre6\bin\

      Path= ...;C:\Program Files\Java\jre6\bin\server\;C:\Program Files\R\R-2.12.1\bin\x64\

    The thing that finally solved my problem was to explicitly add \server\ to the PATH variable.

提交回复
热议问题