Now you can add break point in your project source code, and access your web application hosted on Tomcat to debug.
![intellij remote debug intellij remote debug](https://lightrun.com/wp-content/uploads/2021/05/gPGtpqT.png)
If everything works, you will see the following output in the “Console” tab in the “Debug” tool window:Ĭonnected to the target VM, address: ‘localhost:9999’, transport: ‘socket’ Now, you just need to start Tomcat as usual(run “./bin/startup.sh”), then in IntelliJ IDEA, open “Run -> Debug ‘Tomcat’”. To do so, you need to create a “$/conf/Catalina/localhost/ROOT.xml 1 Third, configure Tomcat to use the project built files as the web application context. And remember to give a name like “Tomcat” for this “run/debug configuration” item. In the “Search sources using module’s classpath:” list, select you project which will running in Tomcat. In the “Port:” field, just write “9999” as you set in the “bin/catalina.sh” file.
#Intellij remote debug update
Note that you only need to update the “Port:” field and the “Search sources using module’s classpath:” list, the “Command line arguments for running remote JVM” will be changed accordingly as you update the “Port” field and does not need manually update. Second, open IntelliJ IDEA community edition, go to “Run -> Edit Configurations”, click the “+” icon and select “Remote” from the list, then you will see a dialog like below: Note the “address=9999” means the network port number used by Tomcat for debugging.
![intellij remote debug intellij remote debug](https://i.stack.imgur.com/f8heP.png)
JAVA_OPTS= " $JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999" # to enable IntelliJ IDEA Community Edition Debugging Feature with Tomcat.
![intellij remote debug intellij remote debug](https://i1.wp.com/raw.githubusercontent.com/mhdr/AndroidSamples/master/105/06.png)
#Intellij remote debug how to
However, in IntelliJ IDEA community edition, how to do it?įirst, update your Tomcat starting script file “bin/catalina.sh”, add the following content right after the “JAVA_OPTS” comment: 1
#Intellij remote debug professional
IntelliJ IDEA professional edtion seems have the same function. In Eclipse EE edition, there is support to debugging web application with web container implementation like Tomcat.