ossiejhmoore

Java Remote Debugging

Aug 28th, 2020
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. How to attach to a remote process using Netbeans. Add the following to the command line switches for launching the application:
  2.  
  3. -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=18889,suspend=y
  4.  
  5.  
  6.  
  7. So if your command line is...
  8.  
  9. java -Xmx1024m -jar MyFile.jar
  10.  
  11. Do this...
  12.  
  13. java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=18889,suspend=y -Xmx1024m -jar MyFile.jar
  14.  
  15. This will suspend the process, listening on port 18889 until your debugger attaches...
  16.  
  17. Do this...
  18.  
  19. java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=18889,suspend=n -Xmx1024m -jar MyFile.jar
  20.  
  21. ...and your process will launch normally but allow you to connect at any time on port 18889.
  22.  
Advertisement
Add Comment
Please, Sign In to add comment