I had some issues installing rJava first. Then I found this solution.
Unfortunately I get following error, when loading the package:
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/informatik2/students/home/1jendryc/R/x86_64-pc-linux-gnu-library/3.1/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
Error: package or namespace load failed for ‘rJava’
Still this file exists and even the path is correct
~/R/x86_64-pc-linux-gnu-library/3.1/rJava/libs$ ls
rJava.so
So I tried that approach, but it didn't worked.
I have no possibility to get root easily, cause I am working at my university at a pool computer.
Cheers.
Your issue is something different. What message says is that it can't find "libjvm.so". You need to properly configure Java, rJava and R. Take a look here
http://www.owsiak.org/?p=3671
where all the caveats are listed when it comes to working with R and Java.
Related
I'm having an issue will installing/ loading some packages in R. When I try to do so, I get the following error:
> library(asreml)
Error: package or namespace load failed for ‘asreml’:
.onLoad failed in loadNamespace() for 'asreml', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/asreml/libs/asreml.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/asreml/libs/asreml.so, 0x0006): Library not loaded: '/opt/homebrew/opt/gcc#11/lib/gcc/11/libgfortran.5.dylib'
Referenced from: '/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/asreml/libs/asreml.so'
Reason: tried: '/opt/homebrew/opt/gcc#11/lib/gcc/11/libgfortran.5.dylib' (no such file), '/usr/local/lib/libgfortran.5.dylib' (no such file), '/usr/lib/libgfortran.5.dylib' (no such file)
The last time I had this issue, I uninstalled and reinstalled the package, and that solved the problem. This time, however, that isn't working. I believe the issue is that it's looking for gcc in
/opt/homebrew/opt/gcc#11/
but 12 is my most current version. HOWEVER, both
/opt/homebrew/opt/gcc#11/
and
/opt/homebrew/opt/gcc#12/
link to
../Cellar/gcc/12.2.0
So I'm not even sure if redirecting it would solve the issue. Any ideas? Thanks!
I've got a server running RStudio, and recently another user updated what version of gcc was on it for another project. I attempted to install Rcpp, and get the following error:
Error: package or namespace load failed for ‘Rcpp’ in dyn.load(file,
DLLpath = DLLpath, ...): unable to load shared object
'/home/username/R/x86_64-redhat-linux-gnu-library/3.5/Rcpp/libs/Rcpp.so':
/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by
/home/username/R/x86_64-redhat-linux-gnu-library/3.5/Rcpp/libs/Rcpp.so)
Error: loading failed Execution halted ERROR: loading failed
Oddly, this doesn't occur when using R from the command line, which makes me think that RStudio Server is having trouble finding GLIBCXX_3.4.20, rather than it being genuinely missing.
Does anyone know how to sort this error out?
I am running R 3.5.0 on a Ubuntu 18.04 machine. Some Shiny app I am testing with this new environment uses the ReporteRsjars package and gives the following error message on loading this package:
Loading required package: ReporteRsjars
Error: package or namespace load failed for ‘ReporteRsjars’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/usr/local/lib/R/site-library/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
Warning: Error in : package ‘ReporteRsjars’ could not be loaded
The file /usr/local/lib/R/site-library/rJava/libs/rJava.sohowever does exist.
Any help would be appreciated!
After quite some more trying I found the solution - and realized that I mis-interpreted the error message: The missing library was actually the libjvm.so which was not found. A symlink
ln -s /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so /usr/lib
followed by a R CMD javareconfand a removal and re-installation of the rJavapackage did it for me.
I keep getting the same error, for both first for XLConnect, (which I thought was a java problem) and now rJava (which is also not working). This is the error message I get when I library(rJava):
Error: package or namespace load failed for ‘rJava’: .onLoad failed
in loadNamespace() for 'rJava', details: call: dyn.load(file,
DLLpath = DLLpath, ...) error: unable to load shared object
'/Users/snyderk2/Library/R/3.4/library/rJava/libs/rJava.so':
dlopen(/Users/snyderk2/Library/R/3.4/library/rJava/libs/rJava.so, 6):
Library not loaded: #rpath/libjvm.dylib Referenced from:
/Users/snyderk2/Library/R/3.4/library/rJava/libs/rJava.so Reason:
image not found
I am new to R, and just need to figure out how to get these packages working, thanks!
Try (check your java version and change accordingly):
Sys.setenv(JAVA_HOME = "C:/Program Files/Java/jre-9.0.1")
And then load library.
Install package xlsx if you are trying to access Excel file by entering install.packages("xlsx", dependencies = T) in your console.
Another R package for working with excel data which does not require rJava is openxlsx. I've found it works faster than java-based packages, which is a nice bonus.
I am trying to get the R package "lsa" running, which in turn requires Snowball, which in turn fails. I'm running OpenSUSE 12.2 with the latest R-patched build (currently 3.01). Here's the thing: the libraries load no problem if I do "sudo R" but if I try to run R the good way, in emacs ESS mode, I don't have sudo and the attempt fails. Here's what I see:
library(lsa)
Loading required package: Snowball
Error : .onLoad failed in loadNamespace() for 'Snowball', details:
call: NULL
error: .onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/usr/lib64/R/library/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
Error: package ‘Snowball’ could not be loaded
This is at the conclusion of a long string of rJava issues.
Suggestions on how I can get this running without sudo (running sudo R just seems dumb, in addition to being a problem for ESS mode)