阅读背景:

配置springboot启动时自动打开浏览器 spring-context-indexer原理_长河的博客_spring-context-indexer

来源:互联网 
int port = 8080;
String portPrefix = "--server.port=";
for (String arg : args) {
    if (arg.startsWith(portPrefix)) {
        port = Integer.parseInt(arg.substring(portPrefix.length()));
    }
}
SpringApplication.run(AppRegisterApplication.class, args);
try {
    Runtime.getRuntime().exec("cmd /c start https://localhost:" + port);
} catch (IOException e) {
    e.printStackTrace();
}int port = 8080;
String portPrefix = "--server.



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: