Since Process.getRunTime().exec() is used for running the system specific commands If I try to run a java class using Process p = RunTime.getRuntime().exec("java ABC"); It doesn't work Can any one suggest me an alternative for it
SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
Othere than your somewhat random capitalization (the class is "Runtime," the method is "getRuntime()") this should work fine given that "java" in on the path, and the CLASSPATH is set appropriately. How do you know it doesn't work? If you're expecting the output to appear on stdout, note that it won't; it goes to an InputStream that you get read from (get it from Process.getInputStream()). If you want to see the process output, you'd have to read it, then print it out.
You pretty much have to read the ouput stream. Otherwise, the process will block when it's output buffer fills up. When and where this happens is OS dependent, but it is something to worry about.