opening a QNX application with a java program

Hello,

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”

Thanks in advance!

James <james.gappy@hap.com> wrote:

Hello,

Please don’t cross-post.

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”

Thanks in advance!


QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Hi David,

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

James


“James” <james.gappy@hap.com> wrote in message
news:a8v0ac$na7$1@inn.qnx.com

Hello,

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”

Thanks in advance!

Hi James,

“James” <james.gappy@hap.com> schrieb im Newsbeitrag
news:a8v0ac$na7$1@inn.qnx.com

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 :wink:
//OR execute the command using its full qualified path & name, eg:
Process pro = rt.exec("/usr/bin/ls");

Thanks in advance!

servuz,
Jochen