error: JAVA_HOME cannot be determined from the Registry (R)

I am trying to follow the instructions from this page to perform "rule mining": fpgrowth: FP-Growth in rCBA: CBA Classifier :

#load library

#load data

#format data
train <- sapply(iris,as.factor)
train <- data.frame(train, check.names=FALSE)
txns <- as(train,"transactions")

#run the desired procedure
rules = rCBA::fpgrowth(txns, support=0.03, confidence=0.03, maxLength=2, consequent="Species",

This returns the following error:

Error: .onLoad failed in loadNamespace() for 'rJava', details:
  call: fun(libname, pkgname)
  error: JAVA_HOME cannot be determined from the Registry

I tried to install/uninstall the necessary packages, but the error is persisting. Does anyone know how to resolve this error?

I have posted the systems log from my R session below:

> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)

Matrix products: default

[1] LC_COLLATE=English_Canada.1252  LC_CTYPE=English_Canada.1252    LC_MONETARY=English_Canada.1252 LC_NUMERIC=C                   
[5] LC_TIME=English_Canada.1252    

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods   base  


This means R is not able to find Java in your system, Do you have Java installed? If so, it matches R's architecture (i.e. x32 or x64)?

If the answer to the previous questions is affirmative, then you have to manually set the path to your Java executable by defining the JAVA_HOME environmental variable in a .Renviron file and restart your R session.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.