[R] Calling R from Java (trying the R interface to Omegahat and Java)

Martin Morgan mtmorgan at fhcrc.org
Sat Mar 21 03:50:46 CET 2009

Michael Kubovy <kubovy at virginia.edu> writes:

> Dear R-helpers,
> I run R version 2.8.1 (2008-12-22) on i386-apple-darwin8.11.1
> I would like to call R from Java. I downloaded SJava_0.69-0.tar.gz,  
> and then issued the command suggested on http://www.omegahat.org/ 
> RSJava/ :

Others will point you to rJava


which might well be a good solution for you; if you have reasons for
using SJava, then the currently maintained version is at


accessible using 'svn' and the instructions at


It has not been tested recently on a mac...

> % R INSTALL -c SJava_0.69-0.tar.gz

This should be

  R CMD INSTALL --clean SJava_0.69-0.tar.gz

> ARGUMENT 'INSTALL' __ignored__
> WARNING: unknown option '-c'
> ARGUMENT 'SJava_0.69-0.tar.gz' __ignored__
> I then tried
> % R CMD INSTALL SJava_0.69-0.tar.gz
> * Installing to library '/Library/Frameworks/R.framework/Resources/ 
> library'
> * Installing *source* package 'SJava' ...
> checking for java... /usr/bin/java
> Java VM /usr/bin/java
> checking for javah... no

you require the JDK (Java Development Kit), not just the JRE (Java
Runtime Environment); if you've got the right software installed, you
should be able to find the program 'javah' on your system. 

Hope that helps,


> Sorry. We can currently only configure this package for IBM, Blackdown  
> or Sun's Java implementation
> ERROR: configuration failed for package 'SJava'
> ** Removing '/Library/Frameworks/R.framework/Resources/library/SJava'
> Can someone tell me what I'm doing wrong? Since this is a matter of  
> some urgency, I would be grateful if you also cc-ed my email address.
> _____________________________
> Professor Michael Kubovy
> University of Virginia
> Department of Psychology
> Postal Address:
> 	P.O.Box 400400, Charlottesville, VA 22904-4400
> Express Parcels Address:
> 	Gilmer Hall, Room 102, McCormick Road, Charlottesville, VA 22903
> Office:    B011;		Phone: +1-434-982-4729
> Lab:        B019;		Phone: +1-434-982-4751
> WWW:    http://www.people.virginia.edu/~mk9y/
> Skype name: polyurinsane
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M2 B169
Phone: (206) 667-2793

More information about the R-help mailing list