[R] rJava on Linux

Ameeta Agrawal messyameeta at gmail.com
Wed Dec 30 08:05:25 CET 2009


Hi,
I seem to have to some problem using the rJava package. Any help is appreciated.

I have a sample java file Hello.java
public class Hello
{
public String sayHello()
{
String result=new String("Helloooooooo");
return result;
}
public static void main(String[] args)
{
}
}



and these are the commands I use on R:

install.packages("rJava")
library('rJava')
.jinit()
h<-("java/lang/String","Hello")
.jcall(h,"S","sayHello")

Error in .jcall(h1, "S", "sayHello") :  method sayHello with signature
()Ljava/lang/String; not found



Could someone point me in the right direction please? Thanks.
PurpleSnow




More information about the R-help mailing list