Execute a Java program from our Java program

后端 未结 14 1854
名媛妹妹
名媛妹妹 2020-12-01 17:24

I used

Runtime.getRuntime().exec(\"_____\")

but it throws a IOException as below:

java.io.IOException: Create         


        
14条回答
  •  日久生厌
    2020-12-01 17:39

    Is there any reason you can't just call it directly in your Java code?

    If there is a reason I've not tried it for executing a Java Program but you could try Jakarta Commons Exec works well for executing most programs.

提交回复
热议问题