when call program with command having no arguments = success
when calling program with command having arguments = epic fail: java.io.ioException: cannot run programĀ ... the handle is invalid.
when calling program with command having arguments, but not passing them = program returns expected result that command is missing argument/parms.
not a java guru, I GREATLY appreciate anyone's help with this.
'CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED javaOsCall as
import java.io.*;
public class javaOsCall {
public static void executeCommand(String[] command) {
try {
final Process pr = Runtime.getRuntime().exec(command);
pr.waitFor();
new Thread(new Runnable(){
public void run() {
BufferedReader br_in = null;
try {
br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
String buff = null;
while ((buff = br_in.readLine()) != null) {
System.out.println(buff);
try {Thread.sleep(100); } catch(Exception e) {}
}
br_in.close();
...