Running an R-Program from Java
<p>I got following simple R-program named <em>hello.R</em>:</p>

<pre><code>print('hello')
</code></pre>

<p>I like to call this code from Java now.
This is my code in Java:</p>

<pre><code>import java.io.IOException;

public class Main {

    public static void main(String[] args) {
        String path = "C:\\Users\\Administrator\\Desktop\\hello.R";
        try {
            Runtime.getRuntime().exec("C:\\Program Files\\R\\R-3.1.3\\bin\\Rscript "+path);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } 

    }

}
</code></pre>

<p>I was expecting it to print the hello statement in the Java concole. But Java program didn't do anything at all.</p>

<p>Do you know what the problem may be?</p>