1、通过Runtime.getRuntime().exec(路径)打开
- public static void main(String[] args) throws IOException {
- //1、打开文件
- Runtime.getRuntime()
- .exec("cmd /c start " + "D:\\qyt\\2023-10-23\\screw\\screw-core\\");
- //2、打开文件夹
- Runtime.getRuntime()
- .exec("cmd /c start " + "D:\\qyt\\2023-10-23\\screw\\screw-core\\pyrx_two_数据库设计文档生成_1.0.0.html");
- }
2、参考文章
https://blog.csdn.net/chaochao2113/article/details/120179439