在 IntelliJ Community Edition 和 Tomcat8 上调试 J2EE 应用程序(运行 作为服务)
Debug J2EE Applications on IntelliJ Community Edition and Tomcat8 (running as a service)
我搜索了很多关于使用 IntelliJ IDEA Community Edition Java 编写的 REST API 的远程调试。
我的设置:
Windows 10
Tomcat 作为 windows 服务安装
Java 8
Intellij 社区 IDE
最后,在谷歌搜索和筛选 SO 之后,找到了一个可行的解决方案。在下方发布。
第一部分。运行宁 Tomcat 在调试模式下
当运行Tomcat8作为服务时
打开{$TOMCAT_HOME}\bin\Tomcat8w.exe
在Java > Java Options
下添加以下行以启用调试端口8001:
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8001
- 重新启动 Tomcat 服务
第二部分。附加 IntelliJ IDEA 远程调试器
使用 Remote
模板创建新的 运行 配置。
下Configuration > Settings
把Port
改成8001
运行点击调试图标新建配置,IDEA会连接到Tomcat
的调试端口
学分:
- How to remotely debug the webapplication running on tomcat service?
我搜索了很多关于使用 IntelliJ IDEA Community Edition Java 编写的 REST API 的远程调试。
我的设置:
Windows 10 Tomcat 作为 windows 服务安装 Java 8 Intellij 社区 IDE
最后,在谷歌搜索和筛选 SO 之后,找到了一个可行的解决方案。在下方发布。
第一部分。运行宁 Tomcat 在调试模式下
当运行Tomcat8作为服务时
打开
{$TOMCAT_HOME}\bin\Tomcat8w.exe
在
Java > Java Options
下添加以下行以启用调试端口8001:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8001
- 重新启动 Tomcat 服务
第二部分。附加 IntelliJ IDEA 远程调试器
使用
Remote
模板创建新的 运行 配置。下
Configuration > Settings
把Port
改成8001运行点击调试图标新建配置,IDEA会连接到Tomcat
的调试端口
学分:
- How to remotely debug the webapplication running on tomcat service?