execute gnuplot from java

Hi,

I want to execute gnuplot from java, I can get the console to open using:

Process theProcess = Runtime.getRuntime().exec("/Java/gnuplot/bin/wgnuplot.exe");

But I want it to open gnuplot and open a file, for example 'foo.bat'. I've tried:

Process theProcess = Runtime.getRuntime().exec("/Java/gnuplot/bin/wgnuplot.exe, foo.bat");

However this throws a file not found exception, any ideas?

Thanks.

[495 byte] By [eadie1984a] at [2007-11-27 10:33:17]
# 1

> Process theProcess = Runtime.getRuntime().exec("/Java/gnuplot/bin/wgnuplot.exe, foo.bat");

> ...

1 - should there be a comma after wgnuplot.exe?

2 - try providing the absolute path for foo.bat like this:

Process theProcess = Runtime.getRuntime().exec("/Java/gnuplot/bin/wgnuplot.exe /path/to/foo.bat");

prometheuzza at 2007-7-28 18:21:52 > top of Java-index,Java Essentials,Java Programming...