This is a short introduction about how to use IntelliJ to debug your GWT application running in SuperDevMode.
- JetBrains IDE Support extension for Crhome: https://chrome.google.com/webstore/detail/jetbrains-ide-support/hmhgeddbohgjknpmjagkdomcpobmllji
- GWT application running in SuperDevMode
- In IntelliJ add a new Run/Debug Configuration of type 'JavaScript Debug'
- Give it a name and enter the URL of your GWT application (that's the one you get if you press 'Copy to Clipboard' in the 'GWT Development Mode' window)
- Choose Chrome as the browser
- Add mapping(s) between your local files and remote URLs. Therefore choose the local path of your (top level) package in the section named 'Remote URLs of local files (optional):' and map it to the related URL of the code server.
Say you have the local pathsrc/main/java/org/jboss/hal/client
and your GWT module has the short namehal
. Then the remote URL would be http://127.0.0.1:9876/sourcemaps/hal/org/jboss/hal/client. - If you have a maven multi module (which is the case for me) you can repeat the last step for each module you want to map. In that case you only need to make sure that you don't map the same URL twice. Use more specific mappings in that case.
- Make sure your GWT application is running in SuperDevMode. I'm using the GWT Maven Plugin from Thomas Broyer (https://tbroyer.github.io/gwt-maven-plugin/plugin-info.html) and execute
mvn gwt:devmode
from the command line. But actually it's up to you how you start SuperDevMode. - Choose your Run/Debug Configuration and click 'Debug' or press ⇧F9
- The start page of your GWT application should be loaded in Chrome.
- In the browser you should see a hint saying "JetBrains IDE support is debugging this browser."
- Depending on your application you should see some output in the console view of IntelliJ.
- Add breakpoints in your code. If you setup the mappings correctly, IntelliJ should be activated pausing at your breakpoint. You can now inspect the local variables and walk down the stack.
- Have fun
Let me know if you have problems setting up remote debugging.
"Give it a name and enter the URL of your GWT application (that's the one you get if you press 'Copy to Clipboard' in the 'GWT Development Mode' window)" - what does "'GWT Development Mode' window" mean? I am stuck on your item #2. What url do i put? I need to debug remote server. The instructions assume I already know EVERYTHING about GWT and how to run it - why then would I need instructions in the first place? Is there way to dumb it down so the mere mortals can understand? Thank you so much in advance.