I recently updated to Sierra and it seems like I can't load packages that depends on rJava anymore.
For example:
library(xlsx)
Gives:
Loading required package: rJava
Loading required package: xlsxjars
JavaVM: requested Java version ((null)) not available. Using Java at "" instead.
JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
JavaVM FATAL: Failed to load the jvm library.
Error : .onLoad failed in loadNamespace() for 'xlsx', details:
call: .jinit()
error: JNI_GetCreatedJavaVMs returned -1
Error: package or namespace load failed for ‘xlsx’
Here is my sessions info:
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Sierra 10.12
And Java is updated to the latest version (8.111).
As far as I can understand from some similar posts the java directories is not configured correctly.
You can solve this with terminal commands that fix the wrongly configured directories and there are multiple posts that use this strategy. But this can be rather confusing.
A much easier strategy that worked for me is to use homebrew to install java. After installing Homebrew you can install java with the following commands
brew update
brew cask install java
Related
I am trying to install the ProStaR and DAPAR packages with Rstudio (R version 3.6.3). Following the instructions from the instruction manual (https://www.bioconductor.org/packages/release/bioc/vignettes/DAPAR/inst/doc/Prostar_UserManual.pdf) after running the following code:
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(version='3.10')
BiocManager::install("DAPAR")
BiocManager::install("Prostar")
library(Prostar)
Prostar()
I receive the following error messages:
>library(Prostar)
Error: package or namespace load failed for ‘Prostar’:
.onLoad failed in loadNamespace() for 'shiny', details:
call: NULL
error: invalid version specification ‘1,5’
> Prostar()
Error in Prostar() : could not find function "Prostar"
When trying to separately install the shiny package:
install.packages("shiny")
library("shiny")
I get the same error message:
Error: package or namespace load failed for ‘shiny’:
.onLoad failed in loadNamespace() for 'shiny', details:
call: NULL
error: invalid version specification ‘1,5’
I have to mention that I'm not extremely familiair with R yet. Any help would be greatly appreciated.
You did not include versions of several items in your setup so it's possible this comes from mismatching components (rather than my initial guess that it was due to a corrupt package from whatever mirror was being used.) I needed to upgrade to R 3.6.3 to match that aspect of your set up and in the process noted that Catalina OS users need a different version of R. I'm on Mojave, so my version now produces this on startup:
R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)
I then needed to update my BioConductor installation which was fairly quick but installing the DAPAR package takes a loooong time because of an extensive list of dependencies, some of which have unmet dependencies that required repeated attempts to get the process to completion. Then the Prostar package installation had another batch of unmet dependencies. After finally getting all the unmet dependencies installed, I'm unable to reproduce the error, so I'm thinking you should probably use another repository. I suggest first doing something like:
options(repos = "https://cloud.r-project.org/")
Or choose that mirror specification from the Rstudio setup panel. Then make another attempt.
I suppose it's possible that this issue arises because of a version mismatch of compilers. The CRAN page for MacOS says clang 7 is needed. In my setup I get this (in a Terminal window)
Comutername:~ myusername$ clang --version
Apple clang version 11.0.0 (clang-1100.0.33.12)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
And for gfortran I get:
GNU Fortran (GCC) 4.2.3
Copyright (C) 2007 Free Software Foundation, Inc.
I did all the R package installations from the R.app interface, so I suppose it's possible that some infelicity in Rstudio's package install process will be needed to explain this. Obviously all teh system installations such as clang and gfortran (and probably PROJ and other GIS packages) would need to be done from the Terminal command line. Sometimes it is safer to do all these installations from a minimal interface, possibly even from R running in a Terminal window. I've generally had good luck with R.app (over a span of 12 years) and less consistent results with Rstudio.
I am running a vanilla copy of R 3.5.2:
> version
_
platform x86_64-apple-darwin18.2.0
arch x86_64
os darwin18.2.0
system x86_64, darwin18.2.0
status
major 3
minor 5.2
year 2018
month 12
day 20
svn rev 75870
language R
version.string R version 3.5.2 (2018-12-20)
nickname Eggshell Igloo
R is installed via Homebrew:
$ brew --version
Homebrew 1.9.2
Homebrew/homebrew-core (git revision de1ec; last commit 2019-01-15)
Homebrew/homebrew-cask (git revision 68a73e; last commit 2019-01-14)
I am trying to install the rgl package from within XQuartz 2.7.11 and the xterm application, and I get the following error:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/local/lib/R/3.5/site-library/rgl/libs/rgl.so':
dlopen(/usr/local/lib/R/3.5/site-library/rgl/libs/rgl.so, 6): Library not loaded: #rpath/libc++.1.dylib
Referenced from: /usr/local/lib/R/3.5/site-library/rgl/libs/rgl.so
Reason: image not found
Error: package or namespace load failed for 'rgl':
.onLoad failed in loadNamespace() for 'rgl', details:
call: NULL
error: Loading rgl's DLL failed.
On MacOS, rgl depends on XQuartz, which you can download from xquartz.org.
Here is a screenshot to confirm that I am attempting the install from within the XQuartz xterm application:
Are there any additional steps required to configure Mac OS X 10.14 and XQuartz 2.7.11, which allows installation of rgl?
I am new to R-programming and I am trying to install Slidify and I am currently having a problem. I am running on the below version of RStudio:
R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
I am using the below code to install Slidify:
install_github("slidify", "ramnathv")
install_github("slidifyLibraries", "ramnathv")*
I get the following error:
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
Error: Command failed (1)
In addition: Warning message:
Username parameter is deprecated. Please use ramnathv/slidifyLibraries
I have also tried the below code to install Slidify:
pkgs <- c('ramnathv/slidifyLibraries', 'ramnathv/slidify')
devtools::install_github(pkgs)*
and I get the following error:
Error: Command failed (1)
Does anyone have experience installing Slidify?
1) install_github() function is in devtools package, so first you have to install this package using install.packages("devtools").
2) Then load the library using
library(devtools)
3) Now use your code
install_github("slidify", "ramnathv")
install_github("slidifyLibraries", "ramnathv")
It will work properly.
I have install.packages("rJava") in R
it is ok
library(rJava) is ok
but when I issue GET request "../library/rJava/R" to opencpu server, it can't be accessed.
../library/rJava is ok
error:HTTP 400 Bad Request,package or namespace load failed for 'rJava'
and /var/log/kern.log: kernel: [92053.630574] type=1400 audit(1427769314.925:227): apparmor="DENIED" operation="open" profile="opencpu-main" name="/proc/21078/stat" pid=21078 comm="sh" requested_mask="r" denied_mask="r" fsuid=33 ouid=33
My Configuration:
R version 3.1.3 (2015-03-09)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu precise (12.04.5 LTS)
Java:version "1.7.0_75"
opencpu:1.4.6
This seems to be a known issue in opencpu and it is in their github too . It is not yet fixed. Please refer this link https://github.com/jeroenooms/opencpu/issues/123 for more details about this bug. I faced this same error when I tried to invoke a function in a package called mallet which depends on rJava.
I have been trying to switch to 64-bit environment but i get stuck with rJava not working.
I have followed thread where people where having the same problem and their solution (JDK, JVM.DLL, environment variables etc..) but i am still stuck
Here is the error i get:
Loading required package: Rbbg
Loading required package: rJava
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'H:/R/R-2.15.2/library/rJava/libs/x64/rJava.dll':
LoadLibrary failure: The specified path is invalid.
Failed with error: 'package 'rJava' could not be loaded'
Here is R.version
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 2
minor 15.2
year 2012
month 10
day 26
svn rev 61015
language R
version.string R version 2.15.2 (2012-10-26)
Thanks in advance
The problem because R can't find the jvm for the 64 architecture.
Normally if you have installed it you will get something like
C:\Program Files\Java\jre7\bin\server
Add this to your windows path and restart R.
Edit To ckeck if all things are right:
Type:
Sys.getenv()['PATH']
you get the environment variables inclusing the path for jvm.dll. If youd'ont have the jvm path here you need to add it using the usual Advanced System Settings method and restart your R console so this take effect.
Sys.getenv()['ProgramW6432']
You get C:\Program Files for the 64 archtitecture.