我运行
java -jar C:\Users\LENOVO\IdeaProjects\support-learning-jp\build\libs\support-learning-jp-0.0.1-SNAPSHOT-plain.jar
,所以它在自动停用之前运行了大约0.381秒,我不知道为什么。我使用java 19。我的应用程序是Spring Boot Rest Api。
i build.gradle 中的配置 jar 文件Gradle 类似图像,但仍然不起作用。
我希望我可以运行 jar 并且 jar 不会自动处于非活动状态。
23:35:04.965 [main] INFO com.example.supportlearningjp.SupportLearningJpApplication -- Starting SupportLearningJpApplication using Java 19.0.2 with PID 12932 (C:\Users\LENOVO\IdeaProjects\support-learning-jp\build\libs\support-learning-jp-0.0.1-SNAPSHOT-plain.jar started by LENOVO in C:\Users\LENOVO\IdeaProjects\support-learning-jp)
23:35:04.968 [main] INFO com.example.supportlearningjp.SupportLearningJpApplication -- No active profile set, falling back to 1 default profile: "default"
23:35:05.219 [main] INFO com.example.supportlearningjp.SupportLearningJpApplication -- Started SupportLearningJpApplication in 0.381 seconds (process running for 0.588)
这是我跑步时的结果
获取干净且最新的构建文件的最佳方法是使用:https://start.spring.io/
选择 Gradle 或 Maven,添加依赖项并生成构建文件。