Can't install rJava 0.9 on Ubuntu 10.04

痞子三分冷 提交于 2019-12-03 23:19:16
Yang

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

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)

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

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} 
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!