Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 tomcat 在本地主机中运行我的项目并使用 cmd 启动它,步骤如下:
在 tomcat\bin 文件夹中,运行 startup.bat。我没有通过 eclipse 运行,因为 tomcat8 正在启动,但是当我点击 localhost 时,它不工作。所以我的问题是如何在通过 cmd 启动 tomcat 时调试代码?
不要使用 startup.bat,而是使用以下命令:
catalina jpda start
然后,在eclipse中,设置一个远程Java应用调试配置:连接类型:标准(Socket Attach),主机:localhost,端口:8000
要调试,请打开 Run->Debug Configurations...,选择您的远程配置,然后单击 Debug。您可以在代码中设置断点并进行调试。