1、设置

编辑catalina.bat,在

rem Guess CATALINA_HOME if not defined
set "CURRENT_DIR=%cd%"
if not "%CATALINA_HOME%" == "" goto gotHome

 

的上面插入以下内容

 

if ""%1"" == ""stop"" goto skip_config
SET CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787

:skip_config

 

其中,suspend=n表示tomcat启动以后不会等待用户debug连接,suspend=y表示会等待。

保存 catalina.bat。

 

2、启动

 你可以手动启动startup.bat,这是及时生效的。也可以在eclipse里启动tomcat,如果不生效就先用startup.bat启动然后用eclipse调试一次,然后关闭tomcat,使用eclipse再次启动tomcat时,debug会自动打开。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
  • 2022-12-23
  • 2021-07-29
  • 2021-11-11
  • 2021-10-29
  • 2021-11-25
猜你喜欢
  • 2021-11-18
  • 2021-11-08
  • 2021-08-27
  • 2021-05-29
  • 2022-12-23
  • 2021-11-25
相关资源
相似解决方案