I need to use the package "xlsx" to export some data on R to excel, but that package requires rJava to run. Whenever I use library(rJava) to call rJava, I get the following error:
Error:.onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Error: package 'rJava' could not be loaded
I honestly cannot make heads or tails of it. What can I do to fix it?
Related
I know there are a lot of questions on this issue. I have previously solved that problem with:
remotes::install_github(c("ropensci/tabulizerjars", "ropensci/tabulizer"), INSTALL_opts = "--no-multiarch")
but I have instaled R 4.2.1 in a new PC and I am not able to fix it this time,
I have succesfully installed rJava package but when I try above code I get this error:
Error: package or namespace load failed for 'tabulizerjars':
.onLoad failed in loadNamespace() for 'tabulizerjars', details:
call: NULL
error: .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
I have re-installed rJava several times but I keep getting the same error.
I would appreciate any help about it.
I'm pretty new to R in Ubuntu.
I am running R (3.5.0) in Rstudio 1.1.456 through Anaconda.
The operating system is Ubuntu 18.04.
In R studio I select the package Rcmdr:
> library("Rcmdr", lib.loc="~/anaconda3/envs/rstudio/lib/R/library")
Loading required package: splines
Loading required package: RcmdrMisc
Loading required package: car
Loading required package: carData
Loading required package: sandwich
Loading required package: effects
lattice theme set by effectsTheme()
See ?effectsTheme for details.
Error: package or namespace load failed for ‘Rcmdr’:
.onLoad failed in loadNamespace() for 'tcltk', details:
call: fun(libname, pkgname)
error: Can't find a usable init.tcl in the following directories:
/builddir/vendor/build/lib/tcl8.6 ./lib/tcl8.6 ./lib/tcl8.6 ./library ./library ./tcl8.6.5/library ./tcl8.6.5/library
This probably means that Tcl wasn't installed properly.
I then tried package tcltk by itself:
> library("tcltk", lib.loc="~/anaconda3/envs/rstudio/lib/R/library")
Error: package or namespace load failed for ‘tcltk’:
.onLoad failed in loadNamespace() for 'tcltk', details:
call: fun(libname, pkgname)
error: Can't find a usable init.tcl in the following directories:
/builddir/vendor/build/lib/tcl8.6 ./lib/tcl8.6 ./lib/tcl8.6 ./library ./library ./tcl8.6.5/library ./tcl8.6.5/library
This probably means that Tcl wasn't installed properly.
Following the question here:
Error ".onLoad failed in loadNamespace() for 'tcltk'"
> capabilities("tcltk")
tcltk
TRUE
Unfortunately the solution above only deals with the case where capabilities("tcltk") comes back with FALSE so I'm stuck at this point!
Also the package tk is showing as installed already in line with the suggestion by J_F in the comments to the original question:
Error: .onLoad failed in loadNamespace() for 'tcltk', details:
Can someone please tell me how to resolve this.
I installed the OpenStreetMap package in R but every time I load the package, I get the following error:
Error: package or namespace load failed for ‘OpenStreetMap’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Can someone explain what could be happening?
Thanks!
I think you have to add JAVA_HOME as a new PATH environment variable. I found all the usefull informations about java here: http://www.ntu.edu.sg/home/ehchua/programming/howto/JDK_HowTo.html
When I want to install the xlsx package, I get this error :
Loading required package: rJava
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
In addition: Warning message:
package ‘rJava’ was built under R version 3.3.3
Error: package ‘rJava’ could not be loaded
So I tried reinstalling rJava, but I get this :
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
In addition: Warning message:
package ‘rJava’ was built under R version 3.3.3
Error: package or namespace load failed for ‘rJava’
Do you guys have any simple solution to this ? I am not very familiar with R, and I just need it to bootstrap some data.
I had the same error recently (R Error: JAVA_HOME cannot be determined from the Registry). I found the solution here. In brief, Joachim Schork identified the problem as not the xlsx package but rather the rjava package. He explained that the problem usually is, as hartmut said, running a 64 bit version of R and a 32 bit version of Java. To resolve the problem according to his recommendation, you need to download and install the 64 bit version of Java. In my case, the solution included installing Java on my machine as it was never installed previously.
First the tech specs of what I am using:
RStudio 0.98.983
R 3.1.1 (64 Bit)
Windows 8.1
When trying to load XLConnect I receive the following error
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Error: package or namespace load failed for ‘XLConnect’
When trying to load RJava I receive the following error
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Error: package or namespace load failed for ‘rJava’
I've checked to make sure the newest updates are installed from CRAN. However I am out of ideas and new to R. Does anyone know how to fix this?
Here is what I posted before:
Meanwhile, I am right now having the problem with the relenium package, which can't locate rJava.
Version mismatches can bedevil you. Check that if your version of R is 32 byte, so must your Java version be. Or, 64 byte must match 64 byte.
Second, I ended up adding to my PATH (I am on Windows 8) the location of the jv.dll file that XLConnect needs (I think that was the name of the file). I found the PATH through Control Panel and System Environment (and maybe more).
Third, the Java site will verify that you have Java installed.
Fourth, with the matching architecture and the PATH pointing to the needed .dll file, I rebooted and it all worked.
Good luck.