using IM commands from Java
Posted: 2012-04-09T13:04:36-07:00
I am trying to run a simple IM command from a Java class and as I have to run only a few commands I thought
instead of using Im4Java ,I could directly use ProcessBuilder.start().
I am using the following code-
but I am getting the error
IOException - Cannot run program "convert" (in directory "/user/gaurav_kl"): error=2, No such file or directory
What could be the reason.
when I run the same command from terminal it works fine from any Dir as IM has been added to classpath
instead of using Im4Java ,I could directly use ProcessBuilder.start().
I am using the following code-
Code: Select all
ProcessBuilder pb = new ProcessBuilder("convert","pic2.png","pic52.png");
pb.directory(new File("/user/gaurav_kl"));
pb.start();
IOException - Cannot run program "convert" (in directory "/user/gaurav_kl"): error=2, No such file or directory
What could be the reason.
when I run the same command from terminal it works fine from any Dir as IM has been added to classpath