maroph

Java Remote Debugging

Dec 21st, 2016
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.55 KB | None | 0 0
  1. # set a port number for the remote debugging
  2. port=4242
  3. #
  4. # Start the JVM and wait for the connection of the debugger
  5. java -Xdebug -Xrunjdwp:transport=dt_socket,address=${port},server=y,suspend=y <java start parameter(s)>
  6. #
  7. # Or: start the JVM and don't wait for the connection of the debugger
  8. java -Xdebug -Xrunjdwp:transport=dt_socket,address=${port},server=y,suspend=n <java start parameter(s)>
  9. #
  10. #
  11. # Start the Java debugger (host: hostname of the machine where the JVM is running)
  12. jdb -connect com.sun.jdi.SocketAttach:hostname=${host},port=${port}
Advertisement
Add Comment
Please, Sign In to add comment