I have the following class :
After compiling my CreateTexts.java class, I want to run it via getRuntime (calling it through Eclipse ). So I run this class
public class RuntimeDemo {
public static void main(String[] args) {
try {
// create a new array of 2 strings
String[] cmdArray = new String[2];
// first argument is the program we want to open
//C:\Program Files\Java\jdk1.6.0_20\bin
cmdArray[0] = "C://Program Files//Java//jdk1.6.0_20//bin//java";
// second argument is a txt file we want to open with notepad
cmdArray[1] = "C://logback//CreateTexts";
// create a process and execute cmdArray and currect environment
Process process = Runtime.getRuntime().exec(cmdArray,null);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
But I'm not seeing the output file being created. Any tips appareciated thanks