7 ms·
For Java programs, you run the JAR with a flag telling it to launch a remote-debug server listening on some port (traditionally 5005): java -jar -agentlib:jd
by gavinray 1y ago
For Java programs, you run the JAR with a flag telling it to launch a remote-debug server listening on some port (traditionally 5005):
java -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
If your app is a gradle app, the flag is "--debug-jvm"
Then you connect to it with "jdb"
- CJefferson 1y agoThanks, I'll try that if I'm ever Java debugging again! I don't think I want to do it myself, but I'd love a "101 ways to get into a debugger" webpage.