|
Do this:
try{
Runtime.getRuntime().exec("javac foo.java");
}
catch(IOException e) {
e.printStackTrace();
}
The method "getRuntime()" returns the Runtime object associated with the current java application.
And the try-catch catches any IO exceptions thrown.
Last edited by jimm1 : 02-16-2008 at 09:11 PM.
Reason: Forgot to include Try-Catch block.
|