一、system:xp+R+jdk+rJava
R:C:\Program Files\R\R-2.15.1 JDK: C:\Program Files\Java\jdk1.7.0_05 1.配置好java 2.配置rJava 1)install.packages("rJava") 2)設(shè)置環(huán)境變量 CLASSPATH=C:\Program Files\R\R-2.15.1\library\rJava\jri; PATH=C:\Program Files\R\R-2.15.1\bin\i386 R_HOME=C:\Program Files\R\R-2.15.1 3)C:\Program Files\R\R-2.15.1\library\rJava\jri的3個類包, 復(fù)制黏貼, 放到C:\Program Files\Java\jdk1.7.0_05\lib下面 JRIEngine.jar JRI.jar REngine.jar 二、system:debian+R+jdk+jre+rJava
1.編譯安裝R,配置R,創(chuàng)建鏈接
/etc/profile
R_HOME= /home/tiger/R-2.15.1
ln
2.安裝jdk,jre,配置java
apt-get install sun-java6-jdk sun-java6-jre
/etc/profile
#jdk
export JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.26"
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:/usr/lib/jvm/java-6-sun-1.6.0.26/lib
#jre
export JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.26/jre"
export PATH=$PATH:$JAVA_HOME/bin
export
CLASSPATH=.:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib
做鏈接
ln -s
3.R CMD javareconf
4.進入R
5.install.packages("rJava")
如果想用java調(diào)用R,還要再次設(shè)置系統(tǒng)環(huán)境變量,前面不能設(shè),根本就還沒有產(chǎn)生rJava的東西,需要現(xiàn)在設(shè)置。
6.chmod 777 -R
/home/tiger/R-2.15.1/lib/R/library/rJava
7./etc/profile
CLASSPATH=.:/home/tiger/R-2.15.1/lib/R/library/rJava/jri
LD_LIBRARY_PATH=/home/tiger/R-2.15.1/lib/R/library/rJava/jri
8.cp /home/tiger/R-2.15.1/lib/R/library/rJava/jri/libjri.so
9.
|
|