spring_reference/III. Using Spring Boot/19.2. Running as a packaged...

12 lines
518 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 19.2. 作为一个打包后的应用运行
如果使用Spring Boot Maven或Gradle插件创建一个可执行jar你可以使用`java -jar`运行你的应用。例如:
```shell
$ java -jar target/myproject-0.0.1-SNAPSHOT.jar
```
运行一个打包的程序并开启远程调试支持是可能的,这允许你将调试器附加到打包的应用程序上:
```shell
$ java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n \
-jar target/myproject-0.0.1-SNAPSHOT.jar
```