zktww

springboot 项目启动自动打开浏览器访问网站设置

在启动类中添加:

// 启动打开默认浏览器访问
        try {
            Runtime.getRuntime().exec("cmd /c start http://localhost:8080/");
        } catch (Exception e) {
            e.printStackTrace();
        }

其中网站修改为自己网址

该操作用途:

当我们使用springboot+vue开发了本地使用插件时,可以在项目启动时,直接打开浏览器相应网址,给予用户可视化页面

 

springboot打包jar转exe启动操作可以看我另一博客:

springboot项目打包jar 并打包为exe启动


 

结束

分类:

技术点:

相关文章:

  • 2021-12-19
  • 2022-01-11
  • 2021-12-19
  • 2021-12-14
  • 2022-02-05
  • 2021-04-30
猜你喜欢
  • 2021-12-19
  • 2021-12-29
  • 2021-11-18
  • 2021-09-11
  • 2021-09-29
  • 2021-12-19
相关资源
相似解决方案