开发者

Execution of curl command in java

开发者_运维百科

We are having a .sh file which executes curl command we need to do the same curl execution of .sh file in java. We are facing problem in replicating the same behavior of .sh execution in java.


Runtime.getRuntime().exec("/path/yourscript.sh");


If you are trying to port your shell script to Java, I recommend using an HTTP library made for Java instead of curl, like Apache Commons HTTP Client.

However, if you really want to execute your shell script inside a Java program, you can use Darin's suggestion to use Runtime.getRuntime().exec("/path/yourscript.sh")

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜