randy3k / radian

A 21 century R console
MIT License
2.02k stars 75 forks source link

rJava cannot be loaded #330

Open drdqde opened 2 years ago

drdqde commented 2 years ago

Hi,

I am using Radian on R-3.4.2 and receive the following error message when I am starting my project in Radian:

Error: package or namespace load failed for 'rJava': .onLoad failed in loadNamespace() for 'rJava', details: call: inDL(x, as.logical(local), as.logical(now), ...) bs/x64/rJava.dll': error: unable to load shared object 'C:/xxx/library/rJava/liva/libs/x64/rJava.dll': LoadLibrary failure: Das angegebene Modul wurde nicht gefunden.

Which basically says the file is not there, but I definitely have it at the specified location.

I found this answer

I guess you just need to expose the path to libjvm.so to the variable R_LD_LIBRARY_PATH.

But unfortunately, I don't know do that. Where do find this R_LD_LIBRARY_PATH? Many thanks in advance!

randy3k commented 2 years ago

Windows doesn't support R_LD_LIBRARY_PATH afaik. You'll need to put the path to rJava.dll to your PATH variable.

drdqde commented 2 years ago

Windows doesn't support R_LD_LIBRARY_PATH afaik. You'll need to put the path to rJava.dll to your PATH variable.

Thanks for the reply! I tried putting the dll into my Windows PATH variable without success (I think this what you suggested). Strangely, it works when I use RStudio or the standard R terminal instead of radian in VSCode.

randy3k commented 2 years ago

Did you try https://stackoverflow.com/questions/2399027/cannot-load-rjava-because-cannot-load-a-shared-library?