error in installing RWeka package in R - r

After getting RWeka package is sucessfully unpacked, when command library("RWeka") is executed it is showing an error:
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname) error: No CurrentVersion entry in
Software/JavaSoft registry! Try re-installing Java and make sure R and
Java have matching architectures. In addition: Warning message:
package ‘RWeka’ was built under R version 3.2.3 Error: package or
namespace load failed for ‘RWeka’

As the error states, make sure you have Java installed of the same architecture as R. For example if you have 32-bit R, you need to have 32-bit Java installed.

If your system is 32 bit, get yourself a 32-Bit java. If the system is 64-Bit go for 64bit java. I faced the same issue as my system is 64-Bit and i accidentally installed 32-Bit java. Uninstalled and reinstalled a 64-bit. Sorted now.

Related

xlsx package can't be loaded

XLSX package is not loading in WIndows 7 with Rstudio 3.5.3
Error: package or namespace load failed for ‘xlsx’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
This error is likely resolved by installing a Java version (e.g. 64-bit Java or 32-bit Java) that corresponds to the type of R version that you are using (e.g. 64-bit R or 32-bit R).
# check which version of R you are running
Sys.getenv("R_ARCH")
# check which version of Java is being utilized by R
system("java -version")
If you need a different version of Java then you'll need to manually download and install the right version from here. Don't forget to restart R and your browser after you install Java.

Installed rJava, Installed Java 8 update. Still cannot load rJava on MacOS Sierra

Bear in mind that I am computer illiterate and new to R. I have installed the rJava package in R studio version 1.0.143 and installed Java 8 (using MacOS Sierra). When I try to load the rJava package:
library(rJava)
I get the following error
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
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/cormac/Library/R/3.4/library/rJava/libs/rJava.so':
dlopen(/Users/cormac/Library/R/3.4/library/rJava/libs/rJava.so, 6):
Library not loaded: #rpath/libjvm.dylib
Referenced from:
/Users/cormac/Library/R/3.4/library/rJava/libs/rJava.so
Reason: image not found
In addition: Warning messages:
1: package ‘rJava’ was built under R version 3.4.2
2: running command '/usr/libexec/java_home' had status 1
Could somebody help me to interpret this error message? There is probably a very simple solution, but I am completely lost. Thank you!!
As noted in Unable to load rJava in RStudio, there is a very specific sequence of steps that must be taken to get rJava to work on a Macbook, as documented in rJava Issues #86.
Download and install Java from Oracle
Uninstall any previously installed version of rJava
Add JAVA_HOME to your .bashrc
Close & restart terminal, R and RStudio sessions so they pick up the updated JAVA_HOME
Use install.packages() to install rJava
See the URL link above for additional details on each step.

rJava Package installation failed (needed for xlsx package)

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.

Error: package ‘rJava’ could not be loaded when installing xlsx

Im trying to install the xlsx package. Installing works fine but when i load the library I get the following error:
> require(xlsx)
Loading required package: xlsx
Loading required package: rJava
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: No CurrentVersion entry in Software/JavaSoft registry! Try re- installing Java and make sure R and Java have matching architectures.
In addition: Warning messages:
1: package ‘xlsx’ was built under R version 3.2.3
2: package ‘rJava’ was built under R version 3.2.3
Failed with error: ‘package ‘rJava’ could not be loaded’
I googled around and say that installing the right version of Java might be the issue. However, when I downloaded the newest version and started a new r-session I still get the same issue.
Are there more people experiencing this issue? And some quick fix?
I am using Linux and when I update R or Java to use the rJava library (needed by xlsx) I need to run this commands form a shell (outside the R session)
sudo su -
R CMD javareconf
I hope this helps.

RJava and XLConnect in RStudio not loading

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.

Resources