View Single Post
  #4 (permalink)  
Old 02-16-2008, 09:06 PM
jimm1 jimm1 is offline
Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 18
jimm1 has a little shameless behaviour in the past
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.
Reply With Quote