hp-ux下
public class Test
{
public static void main(String[] args) throws Exception
{
Process p = Runtime.getRuntime().exec("/usr/dt/bin/dtterm -e /usr/sbin/ping 127.0.0.1 -n 5");
p.waitFor();
}
}
实现弹出新窗口ping 5次
aix下
public class Test
{
public static void main(String[] args) throws Exception
{
Process p = Runtime.getRuntime().exec("/usr/dt/bin/dtterm -e /etc/ping -c 5 127.0.0.1");
p.waitFor();
}
}
实现弹出新窗口ping 5次。
实在是没有solaris的环境,上面两个都验证过了。
注意dtterm和ping的命令的位置写上绝对路径就可以了
whereis dtterm
which dtterm
这两个命令可以帮你找到它们在哪里