“unable to load shared object” when loading the rJava library

前端 未结 2 552
生来不讨喜
生来不讨喜 2021-01-24 18:27

I apologize in advance for my bad english, i hope that someone can help me. I have to load an Excel file .xlsx on R, but:

library(xlsx)
相关标签:
2条回答
  • 2021-01-24 19:03

    This was happening to me as well (also Windows 10), and the problem with mine was that the environment variable was not set properly. In my case, I had to do

    Sys.setenv('JAVA_HOME' = 'C:/Program Files (x86)/Java/jre1.8.0_161/')
    

    Just change the folder name to where Java lives in your computer, and let me know if this doesn't work out.

    0 讨论(0)
  • 2021-01-24 19:14

    In Ubuntu 16.04 I did the following trick in RStudio:

    Sys.setenv('JAVA_HOME' = '/usr/lib/jvm/java-8-oracle/jre')

    Surprisingly, but

    Sys.setenv('JAVA_HOME' = '/usr/lib/jvm/java-8-oracle/')

    didn't work for me.

    0 讨论(0)
提交回复
热议问题