Java debugger extension for VSCode with support for debugging Local variables, arguments, stack trace, step through, partial support for JavaFX, expanding values (Objects, Arrays) etc.
NOTE: Path to JDK is configured in launch.json
- JDK is installed (version 1.7.0 and later)
Once installed, do remember to configure the JDK Path (in launch.json, else jdk path is assumed to be in the current path)
Ensure to compile the source code with debug symbols.
Debug info is needed to compile your code with debugging support, allowing to see variables value
You can configure the tasks.json
file as follows and use run the build task. see -g
flag in command.
{
"version": "2.0.0",
"tasks": [
{
"taskName": "Compile Java",
"type": "shell",
"command": "javac -g ${file}",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Then you need to add a launch configuration (launch.json
):
{
"name": "Java",
"type": "java",
"request": "launch",
"stopOnEntry": true,
"preLaunchTask": "build", // Runs the task created above before running this configuration
"jdkPath": "${env:JAVA_HOME}/bin", // You need to set JAVA_HOME enviroment variable
"cwd": "${workspaceRoot}",
"startupClass": "my.package.MyMainClass", // The class you want to run
"sourcePath": ["${workspaceRoot}/src"], // Indicates where your source (.java) files are
"classpath": ["${workspaceRoot}/bin"], // Indicates the location of your .class files
"options": [] // Additional options to pass to the java executable
"args": [] // Command line arguments to pass to the startup class
}
Debug GUI applications.
Inspect variables, set breakpoints and see output in console.
- Enhancements to java debugger (pause and continue, etc)
- Debugging of Multie Threaded apps is possible but very flaky. The debugger could at times hang.
- Exceptions support #46
- Can't use integrated terminal yet. #71
- Sometimes debugger shows nothing, try to restart it. #27
- Debugging Spring Boot Applications, #13
- Debugging Android. To debug Android use this extension instead.
See ChangeLog
- Fork it https://github.com/DonJayamanne/javaVSCode/fork
- Create your feature branch
git checkout -b my-new-feature
- Commit your changes
git commit -am 'Add some feature'
- Push to the branch
git push origin my-new-feature
- Create a new Pull Request
- DonJayamanne Don Jayamanne - creator, maintainer
- faustinoaq Faustino Aguilar - contribuitor
- lacivert Yasin Okumus - contribuitor
- Sel-en-ium Sel-en-ium - contribuitor
- TSedlar Tyler Sedlar - contribuitor
- rianadon rianadon - contribuitor
- khe817 Ngan Bui - contribuitor
- dlee-nvisia Dave - contribuitor
- llgcode llgcode - contribuitor