Quantcast
Channel: Running external program - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Running external program

$
0
0

What's the difference between running programs using java and run it using the command line? In the first case it does not work, but in the second case it works fine.

Java:

try {    Runtime runtime = Runtime.getRuntime();    Process proc = runtime.exec("../../../my/prog \"//10.124.12.15/C:/output/*\" ../../../input/345 -N -A");    DataInputStream bis = new DataInputStream(proc.getInputStream());    int _byte;    while ((_byte = bis.read()) != -1)        System.out.print((char)_byte);    proc.waitFor();} catch (IOException ex) {    ex.printStackTrace();} catch (InterruptedException ex) {    ex.printStackTrace();}

AND command:

../../../my/prog "//10.124.12.15/C:/output/*" ../../../input/345 -N -A

Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images