Calling gnuplot from java? (ubuntu)

前端 未结 5 1221
余生分开走
余生分开走 2021-01-19 02:52

I\'m not sure if this is possible, especially since Java runs through a VM, but can I call gnuplot from within Java? Perhaps I could have Java open a terminal and input

5条回答
  •  北荒
    北荒 (楼主)
    2021-01-19 02:55

    You can launch any external application using the "exec" commands.

    http://java.sun.com/javase/6/docs/api/java/lang/Runtime.html

    See this page for a few examples. http://www.rgagnon.com/javadetails/java-0014.html

    EDIT: I forgot about ProcessBuilder. Michael Borgwardt's answer is a more robust solution.

提交回复
热议问题