[R-SIG-Mac] configuration failed for package ‘rJava’
simon.urbanek at r-project.org
Fri Apr 20 22:27:19 CEST 2012
On Apr 20, 2012, at 2:59 PM, bugreport19621012 at fastmail.fm wrote:
> I am on a Mac Lion. sessionInfo() is below my signature.
> I attempted to install GGally and its dependencies. This led to the following error:
> ERROR: configuration failed for package ‘rJava’
> and the following piece of advice:
> Make sure you have Java Development Kit installed and correctly registered in R.
> If in doubt, re-run "R CMD javareconf" as root.
> So I ran "R CMD javareconf" as root. This seemed to work fine:
> BEGIN QUOTE
> /Volumes/spin/SoftwareDownload/R> whoami
> /Volumes/spin/SoftwareDownload/R> R CMD javareconf
> Java interpreter : /usr/bin/java
> Java version : 1.6.0_31
> Java home path :
> Java compiler : /usr/bin/javac
> Java headers gen.: /usr/bin/javah
> Java archive tool: /usr/bin/jar
> Java library path: JNI linker flags : -framework JavaVM
> JNI cpp flags : -I$(JAVA_HOME)/include
> Updating Java configuration in /Library/Frameworks/R.framework/Resources
> END QUOTE
> I closed and reopened R and again attempted
> install.packages("rJava", type="source")
> since the binary is not available for Mac.
That is not true - it is available on CRAN:
are you using some incomplete mirror?
> But this returned the same error as before.
> What am I doing wrong?
Make sure you have Java Developer package installed.
On Lion Apple no longer includes headers in the JVM home, so you have to set JAVA_CPPFLAGS to point inside the JavaVM framework:
JAVA_CPPFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers R CMD javareconf
That said, I'd still recommend you use the binary.
> Jacob A. Wegelin
> Assistant Professor
> Department of Biostatistics
> Virginia Commonwealth University
> 830 E. Main St., Seventh Floor
> P. O. Box 980032
> Richmond VA 23298-0032
> R version 2.14.2 Patched (2012-02-29 r58604)
> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
>  en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
> attached base packages:
>  stats graphics grDevices utils datasets methods base
> loaded via a namespace (and not attached):
>  psych_1.1.11 tools_2.14.2
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
More information about the R-SIG-Mac