I want my java program to execute a different java program. I used following method.
(The program I want to run is Example.java)
class RunJava
{
public static void main(String a[])throws Exception
{
Runtime.getRunTime().exec("c:\\"+path+"\\javac Example.java");
Runtime.getRunTime().exec("c:\\"+path+"\\java Example");
}
But it is not working. Is there any other way of doing this?