How to enable remote debugging from IntelliJ with Tomcat?
标签:
intellij-idea
相关问题
- Configure gradle plugin based on future tasks
- How to make available “open this project in Intell
- IntelliJ 2017.1.2 GOLANG debug does not work on br
- JavaFX sample issue
- Could not import the newly generated play framewor
相关文章
- In IntelliJ IDEA, how can I create a key binding t
- IntelliJ IDEA can't open projects or add SDK o
- IntelliJ Subversion Authentication Required Dialog
- Kotlin Koans with EduTools plugin: “Failed to laun
- How to set up Intellij to run javap command on a p
- How to enable “type information” for streams retur
- How to add a project to build path in IntelliJ Ide
- How do I use Gradle bootRun with --args in Intelli
Add these two line to your
bin/setenv.sh
Add remote Run/Debug Configuration in IntelliJ IDEA. (see the answer from @Jonathan L). You can keep the default port '5005'.
Start tomcat,
Then simply run debug on the IDE.
you can set
in
setenv.sh
file inbin
tomcat directory (remote server) and restart it.then just you should add
Remote
in Run/Debug Configurations in intellij and setHost
to remote server andPort
8000Remote debugging of web applications running in Tomcat 7 is extremly convenient in IntelliJ IDEA 12 if you use Maven!
Just configure your pom-file to use the tomcat7-maven-plugin, eg:
Then use the "Maven Projects" tool window to start the tomcat7:run goal in debug mode (see screenshot).
Use Tomcat Run/Debug Configuration. Click the button and choose new
Remote
configuration. In theConfiguration
tab copy the JVM options suggested by IDEA.Run Tomcat with the suggested JVM options:
Press Debug button in IDEA.
Otherwise it's the same as for Local Tomcat, check the tutorial.
Note that deploying to Tomcat is available only in IDEA Ultimate, but you can still manually deploy to Tomcat on your own and use Java's remote debug features using the free edition.
Assume you start Tomcat standalone and attach debugger remotely to it from IntelliJ IDE.
Note:
In Intellij Idea:
Click on Run -> Edit Configurations -> Add New Configurations ("+" icon)
Click on Remote
Set Host and Port
Copy content of Command line arguments for running remote JVM, for example:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000
If you use Tomcat Service (for Tomcat 9):
Go to %TOMCAT_INSTALL_DIR%/bin
Run tomcat9w.exe
Click on Java tab
In Java Options Paste the copied text:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000
Apply.