I am trying to write a java program that will start up ped(the qnx text
editor screen). For some reason, this code doesn’t work on QNX, but when i
try to run notepad.exe on widndows instead, it works. Please help me out.
Thanks
Runtime rt = Runtime.getRuntime();
String cmd = “ped”;
try {
Process pro = rt.exec(cmd);
System.out.println("Process exit code is: " + pro.exitValue());
}catch(IOException ioe) {
System.err.println("IOException: " + ioe);
}
When i run this program, i just get the error message:
“IOException: java.io.IOException: Unable to start program”
This has been answered in a couple of other conferences.
-David
I am trying to write a java program that will start up ped(the qnx text
editor screen). For some reason, this code doesn’t work on QNX, but when i
try to run notepad.exe on widndows instead, it works. Please help me out.
Thanks
Runtime rt = Runtime.getRuntime();
String cmd = “ped”;
try {
Process pro = rt.exec(cmd);
System.out.println("Process exit code is: " + pro.exitValue());
}catch(IOException ioe) {
System.err.println("IOException: " + ioe);
}
When i run this program, i just get the error message:
“IOException: java.io.IOException: Unable to start program”
sorry about the cross-post. I just wasn’t sure where this post belongs since
there are lots of conferences to choose from. Anyways, I appriciate your
help with my question, but I am still having difficulty getting it to work.
Thanks
I am trying to write a java program that will start up ped(the qnx text
editor screen). For some reason, this code doesn’t work on QNX, but when i
try to run notepad.exe on widndows instead, it works. Please help me out.
Thanks
Runtime rt = Runtime.getRuntime();
String cmd = “ped”;
try {
Process pro = rt.exec(cmd);
System.out.println("Process exit code is: " +
pro.exitValue());
}catch(IOException ioe) {
System.err.println("IOException: " + ioe);
}
When i run this program, i just get the error message:
“IOException: java.io.IOException: Unable to start program”
Runtime rt = Runtime.getRuntime();
String cmd = “ped”;
try {
Process pro = rt.exec(cmd);
System.out.println("Process exit code is: " +
pro.exitValue());
}catch(IOException ioe) {
System.err.println("IOException: " + ioe);
}
“IOException: java.io.IOException: Unable to start program”
this is because in your windows environment “notepad” is being found in
%PATH% (eg. c:\winnt)
wheras in a unix environment you should execute this command using following
line
// the second argument is a String array with ENV key/values which are used
when the
// command is being executed
Process pro = rt.exec(“ped”,new String[]{“PATH=/usr/bin”}); // sorry right
now i don’t have access
// to qnx system, enter the PATH-String
// where ped resides
//OR execute the command using its full qualified path & name, eg:
Process pro = rt.exec("/usr/bin/ls");