Hello.
I get a run-time error executing my code. Can anyone tell me why?
Thanks in advance
Here is my class with main():
class ExecDemo{ // Date d = new Date(); public static void main( String args[] ){ Runtime r = Runtime.getRuntime(); Process p = null; try{ p = r.exec("ls"); p.waitFor(); p=r.exec("ping 8.8.8.8"); } catch(Exception e){ System.out.println("Error executing ps"); }//end try..catch block System.out.println("ps returned " + p.exitValue()); System.out.println("Total Memory is: " + r.totalMemory()); System.out.println("Total Memory is: " + System.getProperty("CPU")); }//end main( string args[] ) }