首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

linux下java调用sh的有关问题

2012-01-19 
linux下java调用sh的问题public class STMonitor {public static void main(String[] args) {Runtime rt

linux下java调用sh的问题
public class STMonitor {

public static void main(String[] args) {
Runtime rt = Runtime.getRuntime();

String cmds="sh ststickst.sh";

try {
Process process = rt.exec(cmds);
System.out.println(cmds);
}
catch (IOException ex2) {
System.out.println("执行错误");
}
 
}
}
在linux下执行程序,问什么调用 ststickst.sh 不成功?很困惑,不知道这段代码的问题出在哪里了,请高人指点.
注:jdk是1.3的.

[解决办法]
确认一下ststickst.sh的路径是否正确
[解决办法]
rt.exec(cmds); ???

热点排行