java jar 没有设置活动配置文件,因此 java 自动不活动错误

问题描述 投票:0回答:1

我运行

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。 build.gradle.jar

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)

这是我跑步时的结果

java spring-boot build jar
1个回答
0
投票

获取干净且最新的构建文件的最佳方法是使用:https://start.spring.io/

选择 Gradle 或 Maven,添加依赖项并生成构建文件。

© www.soinside.com 2019 - 2024. All rights reserved.