Hi,

I am trying to integrate my Java program with R using rJava package. I want
to execute the whole Java program from R. The main() method in my Java code
calls all the other defined methods. So, I guess I have to call the main()
method in .jcall.

An example Java code:

*class A {
        public static int mySum(int x, int y) {
                return x+y;
        }
        public static void main (String[] arg) {
                System.out.println("The sum is " + mySum(2, 4));
        }
}*

I can do the following to call the mySum() method:
*.jcall(obj, "I", "mySum", as.integer(2), as.integer(4))*
This will give the output *6*.

But can some one explain me that how exactly I can execute this program to
print *The sum is 6* from R? OR how can I call the main method?
I am a beginner in R.

Thanks,
Gaurav

	[[alternative HTML version deleted]]

