Reputation: 1560
I've searched a lot on Remote Debugging a REST APIs written in Java using IntelliJ IDEA Community Edition.
My Setup:
Windows 10 Tomcat installed as a windows service Java 8 Intellij Community IDE
Finally after some googling and sifting through SO, found a solution that works. Posting it below.
Upvotes: 0
Views: 602
Reputation: 1560
Part I. Running Tomcat in Debug Mode
When running Tomcat8 as a service
Open {$TOMCAT_HOME}\bin\Tomcat8w.exe
Under Java > Java Options
add the following lines to enable the debug port 8001:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8001
Part II. Attaching IntelliJ IDEA Remote Debugger
Create a new Run Configuration using the Remote
Template.
Under Configuration > Settings
Change the Port
to 8001
Run the new config by clicking on the debug icon and IDEA will connect to the debug port of Tomcat
Credits:
Upvotes: 1