views:

53

answers:

3

Hi, is there something like API built atop the standard ProcessBuilder for calling system programs? I won't argue that scripts can be ported to Java but utilities like arping and netstat are good-to-go in Linux.

+3  A: 

Why not just use the standard ProcessBuilder class... It handles calling scripts pretty well. Here is a post showing how this can be used to call a command via bash.

Reed Copsey
+3  A: 

Have a look at Apache Commons Exec.

Pascal Thivent
Thanks, I'm using few projects from Apache commons but I never spotted this one.
Zeratul
+2  A: 

Using Runtime.getRuntime().exec(...) except you need to know the name and parameters to pass to system program.

jex
Hi, I was asking for API deliberately because my next work will make heavy use of calling programs and as a part of exploration whether or not to try write one.
Zeratul