Skip to content

Installation manual

AQLT edited this page Jun 3, 2020 · 2 revisions

To use RJDemetra you need Java 8 or higher. If you don't (or if your R session is wrongly configure) you will have an error loading RJDemetra since release 0.1.3.

To check which version Java version is used you can run the following code:

library(rJava)
.jinit()
.jcall("java/lang/System", "S", "getProperty", "java.runtime.version")

If you have Java 7 or lower and you can't update it (for example for security reasons) you can install a portable version of Java. There are several websites where you can download a portable version of Java, for example:

If you use a 64-bit of R be sure to install a 64-bit version of Java. When the portable version is installed and unzip, you just need to use configure the environment variable JAVA_HOME with the command Sys.setenv() BEFORE loading RJDemetra or rJava. Thus, if you already have loaded RJDemetra or rJava, you have to restart your R session. If Java is installed in D:/Software/Java64:

Sys.setenv(JAVA_HOME='D:/Software/Java64')

And to check the value of the environment variable:

Sys.getenv("JAVA_HOME")

If you use Windows, you can also set the environment variable JAVA_HOME of your user account for not having to set it each time you open R. See for example https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html.

If you have trouble installing the package you can try with the argument INSTALL_opts = "--no-multiarch":

# For CRAN release:
install.packages("RJDemetra", INSTALL_opts = "--no-multiarch")
# For development version:
devtools::install_github("jdemetra/rjdemetra", INSTALL_opts = "--no-multiarch")
Clone this wiki locally
You can’t perform that action at this time.