Demand: 通过Java代码直接运行exe文件
Solution:
public class Test {
public static void main(String[] args) {
try {
Process p = Runtime.getRuntime().exec("D:\仓库\桌面\ObjectManager\enen\gameo.exe");
} catch (Exception e) {
e.printStackTrace();
}
}
}
直接运行main方法,即可运行exe文件。后期可以配合使用点击事件去运行exe文件。



