简体   繁体   English

如何在命令提示符下使用tomcat调试Web项目

[英]how to debug web project using tomcat using command prompt

I am trying to run my project in local host using tomcat and starting it using cmd, steps below: 我试图使用tomcat在本地主机中运行我的项目,并使用cmd启动它,步骤如下:

in the tomcat\\bin folder, running startup.bat. 在tomcat \\ bin文件夹中,运行startup.bat。 I am not running thru eclipse as tomcat8 is starting up but when i hit the localhost, it is not working. 由于tomcat8正在启动,因此我无法通过eclipse运行,但是当我进入本地主机时,它将无法正常工作。 so my question is how can I debug the code while I am starting tomcat thru cmd? 所以我的问题是当我通过cmd启动tomcat时如何调试代码?

Instead of using startup.bat, use this command: 代替使用startup.bat,使用以下命令:

catalina jpda start

Then, in eclipse, set up a up a Remote Java Application debug configuration: Connection Type: Standard (Socket Attach), host: localhost, port: 8000 然后,在eclipse中,设置一个远程Java应用程序调试配置:连接类型:标准(套接字连接),主机:localhost,端口:8000

To debug, open Run->Debug Configurations..., select your remote configuration, and click Debug. 要进行调试,请打开运行->调试配置...,选择远程配置,然后单击调试。 You can set breakpoints in your code and debug. 您可以在代码中设置断点并进行调试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM