Error loading rJava.so when using ReporteRsjars - r

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.

Related

error message trying to install homals package in R

I'm trying to install the Homals package - library(homals), but keep getting this error message:
library(homals)
Error : .onLoad failed in loadNamespace() for 'rgl', details: call:
dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared
object
'/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so,
6): Library not loaded: /opt/X11/lib/libGLU.1.dylib Referenced from:
/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so
Reason: image not found Error: package or namespace load failed for
‘homals’
I have a couple of my colleagues to run the same code, the same thing happens. I have re-install R studio to the newest version.
install.packages("rgl")
install.packages("homals")
library(homals)
Any solutions for this? thank you.
I was able to successfully install on both Windows and Mac. I believe the root cause here is that you have R version 3.3 installed when you require at least v3.5.3 as per below:
library(homals)
Warning message:
package ‘homals’ was built under R version 3.5.3

Error when trying to load XLConnect Package

After updating to the latest version of Rstudio (R version 3.4.1 (2017-06-30) -- "Single Candle") I cannot seem to get the XLConnect Package to load. This is the error message I get:
> library('XLConnect')
Loading required package: XLConnectJars
Error: package or namespace load failed for ‘XLConnectJars’:.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: #rpath/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so
Reason: image not found
Error: package ‘XLConnectJars’ could not be loaded
R also throws a similar error message when I try to load the rJava package as well. I have tried uninstalling both Java and R and have scoured SO for answers, but nothing seems to work.
I am running macOS Sierra (10.12.6)
Would anyone be willing to offer any help?
The error suggests that there is an issue loading rJava. Try updating the Java configuration variables via R CMD javareconf or sudo R CMD javareconf.

ggplot2 package failing to load

I just recently updated my Rstudio to the 0.98.1103 release and now I'm unable to load ggplot it keeps throwing the following error. Any ideas what is going on?
> library(ggplot2)
Error : .onLoad failed in loadNamespace() for 'tcltk', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so, 10): Library not loaded: /usr/X11/lib/libXft.2.dylib
Referenced from: /usr/local/lib/libtk8.6.dylib
Reason: image not found
Error: package or namespace load failed for ‘ggplot2
I tried removing the tcltk library and ggplot2 and reinstalling them now I'm getting a different set of errors:
> library(ggplot2)
Error : package ‘tcltk’ does not have a namespace
Error: package or namespace load failed for ‘ggplot2’
> library(tcltk)
Error in library(tcltk) : ‘tcltk’ is not a valid installed package
Seems like X11 is not installed on your system. Try installing xorg (if you're running Linux) or XQuartz if you're on OSX.

Error loading rJava in R (Ubuntu 12.04)

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.

R unable to load package Snowball, rJava

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)

Resources