Problems with getRuntime().exec()
Hello!
I'd like to start a process which will run a C executable.
The C executable named dbc is placed in the folder
/home/swkm/services/rul_hyb/rul-1.0/bin and accepts as an argument the name of a database, for example, myDB
I tried the following code:
File f =new File(filePath);
Process process = Runtime.getRuntime().exec
(
new String[]
{
"dbc",
"myDB"
}, null,f
);
where filePath is the above mentioned path.
The problem is that I receive an:
java.io.IOException: java.io.IOException: dbc: not found
at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
I tried the new Tiger version of ProcessBuilder in the following manner:
ProcessBuilder process =new ProcessBuilder
(
new String[]
{
"dbc",
"myDB"
}
);
process.directory(new File(path));
Process p=process.start();
but I got the same exception: "dbc not found"
Do you have any idea what is going wrong?
Thank you very much
With best regards,
Sorin

