我想这样做:
Runtime rt = Runtime.getRuntime();
try {
rt.exec("notepad");
} catch (IOException ioe) {
ioe.printStackTrace();
}
在小程序内(从本地 html 网页调用)可能吗?我记得一些有关 java 安全模型的信息,但我不确定。
最佳答案
请看这个问答:Can trusted 1.5 applets execute system commands?来回答你的问题。
关于java - 是否可以从小程序执行命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5459496/