how to run a command at terminal from java program?

前端 未结 6 2165
孤城傲影
孤城傲影 2020-11-29 03:14

I need to run a command at terminal in Fedora 16 from a JAVA program. I tried using

Runtime.getRuntime().exec(\"xterm\"); 

but this just op

6条回答
  •  甜味超标
    2020-11-29 04:04

    I know this question is quite old, but here's a library that encapsulates the ProcessBuilder api.

提交回复
热议问题