Runtime class in java
How to execute a java program with the help of Runtime.getRuntime().exec(). For example we shall have the java file path as c:/java/abc.java. Please help me with the code. Assuming that abc.java contains a main method that you want to execute: Runtime.getRuntime().exec("javac c:\java\abc.java -d c:\java\") Runtime.getRuntime().exec("java c:\java\abc") VonC Do not forget that: you may need to read stdout/stderr of a java program you may have to set/update environment variable and PATH before executing your java command CreateProcess: c:\j2sdk1.4.0\bin\helloworld error=2 means Win32's