You can also check the version selected by your settings via /usr/libexec/java_home in the Terminal. Most recent rJava version will try to automatically detect the Java location and load it dynamically. For example, if installing Zulu, unpack/move it such that it results in /Library/Java/JavaVirtualMachines/zulu-11.jdk. When installing from a zip or tar ball, put your Java installation in /Library/Java/JavaVirtualMachines. Please note that if you are using arm64 R on Apple silicon (M1+) based Macs you will need latest R-4.1.1-patched from or else you will get trap R errors when loading Java (see #267 for details). Probably the most commonly used distribution on macOS are and Azul Zulu. On modern macOS versions Apple no longer supplies Java, so it must be downloaded from 3rd parties.
RJava determines the Java location from the registry, so make sure you use the official Oracle installer so that your Java installation can be found. Teh most common mistake is to use 64-bit R but only have 32-bit Java installed.
#R rjava windows install#
R from CRAN is installed by default both in 32-bit and 64-bit versions so if in doubt, install both 32-bit and 64-bit Java. Please make sure you install Java that matches your R architecture. rJava attempts to find the correct settings automatically on most platforms, so setting JAVA_HOME incorrecty will just break things. Rule #1: do not set JAVA_HOME unless you are an expert.
Generate one (which involves compilation of Java code). Since the checkout is not the actual R package but a source to Package from the source checkout, you must use sh mkdist to do so Since rJava includes REngine as a submodule.