radian icon indicating copy to clipboard operation
radian copied to clipboard

rJava package not loading

Open chrisoswald opened this issue 4 years ago • 8 comments

Hello some years ago I had the following error with linuxmint.

Error: package or namespace load failed for ‘rJava’: .onLoad in loadNamespace() für 'rJava' fehlgeschlagen, Details: Aufruf: dyn.load(file, DLLpath = DLLpath, ...) Fehler: kann shared object '../R/x86_64-pc-linux-gnu-library/3.4/rJava/libs/rJava.so' nicht laden: libjvm.so: Kann die Shared-Object-Datei nicht öffnen: Datei oder Verzeichnis nicht gefunden

But the rJava.so file is at the given location.

Now I have the same error with windows 10. But where is the libjvm.so under Windows? How can I set the R_LD_LIBRARY_PATH? Or is there another solution?

any ideas? Thanks

chrisoswald avatar Dec 15 '20 17:12 chrisoswald

Should it be rJava.dll instead of rJava.so? The library extension on Windows should be dll.

There is no R_LD_LIBRARY_PATH on Windows. One solution is to put the path to the dll in the PATH variable before launching radian.

randy3k avatar Dec 16 '20 05:12 randy3k

Does randy3k depend on rJava? :open_mouth:

cycle20 avatar Dec 16 '20 09:12 cycle20

Does randy3k depend on rJava? :open_mouth:

Me? No.

I guess you were asking about radian though. The answer is still no anyway.

randy3k avatar Dec 16 '20 13:12 randy3k

:laughing: Wow. Sorry. I really mistyped it. I was confused or drunk... Please, don't use numbers in your nickname. :wink:

Good to know this rJava question is not related to radian and it is just an R/rJava config issue. I would like to build radian into my daily routine. A Java-backend/service would discourage me.

Thank you for your contribution to the open source community. :bowing_man:

cycle20 avatar Dec 16 '20 14:12 cycle20

I have tried setting the path to the rJava.dll (of course it's not the so-file) But these setting don't changed anything. I have tried it in the 32bit and 64bit R-console and it works without problems.

Thanks, Christian

PS Radian don't depend to rJava thats clear, but I cannot load rJava in the radian console. Sadly there are lots of R-packages depending from rJava and all of them don't load. I also like to use radian in my daily work but without loading rJava-depending packages I cannot work.

chrisoswald avatar Dec 16 '20 15:12 chrisoswald

Could you show me the exact error message?

randy3k avatar Dec 16 '20 23:12 randy3k

Here is it, sorry but it's in german :-)

r$> library("rJava") Error: package or namespace load failed for 'rJava': .onLoad in loadNamespace() für 'rJava' fehlgeschlagen, Details: Aufruf: inDL(x, as.logical(local), as.logical(now), ...) Fehler: unable to load shared object 'C:/Users/Christian Oswald/R/win-library/4.0/rJava/libs/x64/rJava.dll': LoadLibrary failure: Das angegebene Modul wurde nicht gefunden. r$>

chrisoswald avatar Dec 17 '20 12:12 chrisoswald

Here is it, sorry but it's in german :-)

r$> library("rJava") Error: package or namespace load failed for 'rJava': .onLoad in loadNamespace() für 'rJava' fehlgeschlagen, Details: Aufruf: inDL(x, as.logical(local), as.logical(now), ...) Fehler: unable to load shared object 'C:/Users/Christian Oswald/R/win-library/4.0/rJava/libs/x64/rJava.dll': LoadLibrary failure: Das angegebene Modul wurde nicht gefunden. r$>

Similar problems occurred too. The error message was just the same as yours. The rJava could be successfully loaded in native R console and RStudio.

zhangyz1997 avatar Sep 06 '21 16:09 zhangyz1997