I use R 2.13 from the CRAN apt repo for Ubuntu 10.04, and I\'m trying to install Deducer, which requires JGR/rJava, but rJava refuses to build/install, complaining about being u
Dah, not long after posting I found the answer here:
http://r-interface.blogspot.com/2012/04/install-r-jgr-and-deducer-in-ubuntu.html
Although I already had Sun Java installed, the key was to run update-java-alternatives
to actually switch to Sun Java first before running javareconf:
sudo update-java-alternatives -s java-6-sun
sudo R CMD javareconf
DWright is right..an alternative instead export it every time than you start R is locate your java path
sudo locate libjvm.so
and add ir to ldpaths
sudo gedit /etc/R/ldpaths
i.e
${JAVA_HOME=/usr/java/jdk1.7.0_07/jre}
Here's another option:
before running R, do this
export LD_LIBRARY_PATH=/usr/lib/jvm/java-1.6.0-openjdk/jre/lib/amd64/server
(for path above, substitute location of your particular libjvm.so, if you have a different configuration). To find libjvm.so, you can do
sudo updatedb && locate libjvm.so
One other (relatively obvious) warning: don't do what I did and install both java6 and java7. That led to a conflict I was unable to 'fix' via specifying paths and environment variables. Removing both and reinstalling java6 led to successful installation of JGR. ( This under ubuntu precise, on an Apple G4 powerbook)