Cannot load rJava because cannot load a shared library

后端 未结 6 535
陌清茗
陌清茗 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:43

    Following up on some of Dirk's sage advice:

    • Your path should probably say C:\Program Files\Java\jre6\bin\ (remove "client").
    • Your path should also have C:\Program Files\R\R-2.10.1\bin\. You don't need that explicit reference to the rJava libs. I would also then remove C:\Program Files\R from the path.
    • Lastly, confirm that Java is accessible by either going to your command prompt and typing java -version, or from within R by typing system("java -version").
    • If you install the SDK, then you will also want a system variable JAVA_HOME which in my case points to C:\Sun\SDK\.

提交回复
热议问题