如何启动spring boot的嵌入式tomcat服务器并以调试模式启动服务器

时间:2018-02-01 18:00:36

标签: tomcat

我需要启动spring boot的嵌入式tomcat服务器并以调试模式启动服务器

2 个答案:

答案 0 :(得分:1)

您可以在cmd中执行以下操作:

java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n -jar <jar-name>

这将打开调试模式,您可以通过提供端口8000来连接Eclipse。

答案 1 :(得分:0)

I found the way to do that .

We can use maven to package the project like:

mvn clean package

and then start the server by :

java -jar .\target\springweb-0.0.1-SNAPSHOT.jar

and also can start it in debug mode :

java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n -jar .\target\springweb-0.0.1-SNAPSHOT.jar

found in https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-running-your-application.html