R and Java – JRI using eclipse on 64 bit machines

April 11, 2011

(This article was first published on R – StudyTrails, and kindly contributed to R-bloggers)

Update – Check out the new RJava Eclipse Plugin.
The steps to install rjava on a 64 bit machine is not very different from installing it on a 32 bit machine. however, here are the exact steps.

1. Install 64 bit java.
2. Install R 2.12.X
3. Start R and install the rjava package using the package installer.
4. Start eclipse. Create a project called RTest. copy the Rtest.java and RTest2.java files from the examples folder of rjava (R-2.12.2libraryrJavajriexamples)
5. Create a lib folder in the RTest project and copy the jri.jar file from R-2.12.2libraryrJavajri into it.
6. add jri.jar to the classpath of the project. ensure that the project compiles without error.
Here’s the folder structure

7. Before running the RTest.java class, the run configuration needs to be edited. open the run configuration by clicking on run->run configuration. select Rtest as project and rtest as the main class. click on environment and add the variable ‘PATH’ . the path should contain paths to the following
a. the bin directory of R (64) : R-2.12.2binx64;

b. The jri directory for rjava (64bit) : R-2.12.2libraryrJavajrix64.

8. click on apply and then run.

To leave a comment for the author, please follow the link and comment on their blog: R – StudyTrails.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)