I have installed ffprobe in mac and the directory is /usr/local/bin/ffprobe. When I run the ffprobe command in terminal, it works fine but when I run it in eclipse through ProcessBuilder, it does not run and throws exception as Caused by: java.io.IOException: Cannot run program "ffprobe": error=2, No such file or directory.
But, when I run ProcessBuilder giving the absolute path of ffprobe, it works fine.
Working code:
sample args:[/usr/local/bin/ffprobe, -v, quiet, -print_format, json, -show_format, -show_streams, some_url]
ProcessBuilder pb = new ProcessBuilder(cmdArgs);
Process proc = pb.start();
But, if args is [ffprobe, -v, quiet, -print_format, json, -show_format, -show_streams, some_url]
it throws error. How can I run ffprobe command without giving absolute path? I have already followed this post but could not help on my issue.
My java process in eclipse is running at
Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/