= JRE Installation Installation of the Java Platform, Standard Edition Runtime Environment (JRE), allows you to run Java programs on your PC and as you browse the Internet. The `ecomsUDG.Raccess` package needs the JRE in order to use the powerful capabilities of the [http://www.unidata.ucar.edu/downloads/netcdf/netcdf-java-4/index.jsp netCDF Java Library]. It is very likely that JRE is already installed on your computer, but just in case it is not, here are some instructions on how to get it. === Linux users To find out if JRE is installed in your machine, and in negative case to get instructions on how to install it, please refer to [http://ice.he.net/~hedden/jrelinux.html this link] === Windows / Mac users Click on the link below to download the JRE installer and perform the installation procedure by keeping the default installer settings. For Windows users, please be sure that you have downloaded the 32-bit JRE installer as indicated below. [http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html JRE installer download link] (version 7 update 60): [[Image(image-20140708-115057.png)]] = Installing the `rJava` package [http://cran.r-project.org/web/packages/rJava/index.html rJava] is a R package providing a low-level interface to Java from R. If Java is installed and adequately configured in your computer, the `rJava` package will be automatically downloaded if not present when installing the `ecomsUDG.Raccess` package, as any other package dependency. Therefore, in principle you should not worry about this and could skip this section. But just in case something related to `rJava` goes wrong during the installation, please bear in mind the following information: Once Java is installed in your machine, in most cases the following call from R should do the trick: {{{ #!text/R > install.packages("rJava") }}} === Linux Linux users can alternatively use the ''apt-get'' choice from the terminal: {{{ ~$ apt-get install r-cran-rjava }}} (In case of doubts, there is a recent discussion on both choices [http://stackoverflow.com/a/2170103 at this link] that you may find helpful). You can also find useful information about the installation and configuration of openJDK in [http://askubuntu.com/questions/98319/correct-installation-and-configuration-of-openjdk-and-r this thread] of the Ubuntu forum. === Mac OS X Mac OS X comes with Java pre-installed, so everything should ‘just work’. But if you are having problems with newly installed Java version please take a look to this: [http://stackoverflow.com/questions/26948777/how-can-i-make-rjava-use-the-newer-version-of-java-on-osx] === Windows For Windows 7, you can find some quick advice on how to get up and running with R + rJava [http://stackoverflow.com/questions/7019912/using-the-rjava-package-on-win7-64-bit-with-r/7604469#7604469 at this link] If an error likes this one appears on your `R` console: {{{ Error : .onLoad failed in loadNamespace() for 'rJava', details: call: inDL(x, as.logical(local), as.logical(now), ...) error: unable to load shared object 'C:/Users/antonio/Documents/R/win-library/3.2/rJava/libs/x64/rJava.dll': LoadLibrary failure: %1 no es una aplicación Win32 válida. Error : package 'rJava' could not be loaded }}} it can be due to a misconfiguration of `JAVA_HOME` environment variable. Please check that the corresponfing value points to the '''correct Java version and bit architecture''' (32 or 64). {{{ #!text/R > Sys.getenv("JAVA_HOME") }}} You can remove from system environment and restart `R` or remove from `R` sesssion: {{{ #!text/R > if (Sys.getenv("JAVA_HOME")!="") + Sys.setenv(JAVA_HOME="") }}} or you can force the JVM (): {{{ #!text/R > Sys.setenv(JAVA_HOME="C:\\Program Files (x86)\\Java\jdk1.7.0\\jre") }}} and check which JVM is using rJava: {{{ #!text/R >.jinit() > .jcall("java/lang/System", "S", "getProperty", "java.vendor") [1] "Oracle Corporation" > .jcall("java/lang/System", "S", "getProperty", "java.runtime.version") [1] "1.7.0-b147" > .jcall("java/lang/System", "S", "getProperty", "os.arch") [1] "x86" }}} = Find out the java version used by R Once `rJava` is installed, you may want to know the characteristics of the java version used by R: {{{#!text/R library(rJava) .jinit() [1] 0 .jcall("java/lang/System", "S", "getProperty", "java.vendor") [1] "Oracle Corporation" .jcall("java/lang/System", "S", "getProperty", "java.runtime.version") [1] "1.7.0-b147" .jcall("java/lang/System", "S", "getProperty", "os.arch") [1] "x86" }}}