For R & Java Connection
I write this program
import java.util.Vector;
import org.rosuda.Rserve.*;
class rNumber {
public static void main(String[] args){
public class RConnection extends Rengine{
RConnection c = new RConnection();
double d[] = c.eval("rnorm(10)").asDoubles();
}
}
}
thi开发者_如何学运维s program give error illegal start of expression & ; is expected
You can't declare a public class inside a main function... Declare the class outside. Besides, I don't see the point of your rNumber
class.
You might do something like this instead :
import java.util.Vector;
import org.rosuda.Rserve.*;
public class RConnection extends Rengine{
public static void main(String[] args){
RConnection c = new RConnection();
double d[] = c.eval("rnorm(10)").asDoubles();
}
}
精彩评论