Installation of FastRet consist of the following three steps, which are explained in detail in the following sections.
- Install Java Development Kit (JDK) version 11 or higher
- Use
install.packages("pak")
to install the R package managerpak
from CRAN - Use
pak::pkg_install("FastRet")
to installFastRet
from the GitHub repository
Install Java Development Kit (JDK)
FastRet uses the rJava
package, which itself requires
the Java Development Kit (JDK) version 11 or higher. You can test
whether you java a sufficiently high version of JDK already installed on
your system by entering the following command in your terminal.
If you do not have a suitable JDK installed, you can download and install it from various vendors such as the Adoptium Working Group or Azul. For a list of vendors providing JDKs, see whichjdk.com.
When installing a JDK, there a few things to look out for, e.g.:
- Windows users should activate the update of “JavaSoft registry keys”
during the installation process. This is necessary for the
rJava
package to find the SDK installation. Depending on the SDK vendor you choose, the option might be named differently. - macOS users must use at least R-4.1.2.
- Linux users should run
R CMD javareconf
after installing the JDK to make sure that R can find the JDK.
Install the R package manager pak
This can be done by entering the following command in an R session:
install.packages("pak")
Install FastRet
To install FastRet from the GitHub repository, enter the following command in an R session:
pak::pkg_install("FastRet")
Troubleshooting
JAVA_HOME cannot be determined from the Registry
The error message
JAVA_HOME cannot be determined from the Registry
indicates
that the rJava
package cannot find the JDK installation.
This can cause further errors such as
ERROR: lazy loading failed for package 'FastRet'
when
trying to load FastRet. See rJava
installation fails for possible solutions.
rJava installation fails
If the installation of the rJava
package fails:
- Make sure you have a suitable JDK installed on your system, as described in Install Java Development Kit (JDK).
- Reinstall the
rJava
package by entering the following command in an R session:install.packages("rJava")
. - Run
library("rJava")
to ensure that the package can be loaded.
If this doesn’t solve your problem, have a look the Troubleshooting Guide of the rJava package.