linux环境下java调用.sh文件带参数

linux环境下java调用.sh文件带参数,第1张

试试另一种方法

String[] cmd = {"/home/xiang/start.sh", "参数1", "参数2"}

Runtime.getRuntime().exec(cmd)

public static void main(String args[]){

//args 就是命令行参数

}

环境参数

System

static Map<String,String>

getenv()

Returns an unmodifiable string map view of the current system environment.

static Properties

getProperties()

Determines the current system properties.


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/8970589.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-23
下一篇2023-04-23

发表评论

登录后才能评论

评论列表(0条)

    保存