Skip to main content

Debugging

Debugging is an essential part of Java development, helping developers identify and fix issues efficiently. This guide explains how to configure debugging in webforJ for Visual Studio Code, IntelliJ IDEA, and Eclipse.

  1. Open your webforJ project in VS Code.
  2. Press Ctrl + Shift + D (or Cmd + Shift + D on Mac) to open the Run and Debug panel.
  3. Click "create a launch.json file"
  4. Select Java as the environment.
  5. Modify launch.json to match the following:
launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Attach to Jetty",
"request": "attach",
"hostName": "localhost",
"port": 8000
}
]
}
  1. Save the file and click Start Debugging.

Running the debugger

Once you’ve configured your IDE:

  1. Start your webforJ app using mvnDebug jetty:run.
  2. Run the debug configuration in your IDE.
  3. Set breakpoints and begin debugging
Debugging Tips
  1. Ensure port 8000 is available and not blocked by any firewall.
  2. If you are using any of the webforJ archetypes and have changed the port number in the pom.xml file, make sure the port used for debugging matches the updated value.