4

I have a core java app running on a computer on my network. Can I attach a debugger (netbeans preferred) to this from another computer on the same network?

Please advise how to do this if it is possible, or point me to an article I've had a terrible time googling for it. I don't see why it shouldn't be possible.

Thanks

Kamiikoneko
  • 785
  • 5
  • 12
  • 24

2 Answers2

8

Yes, you can.

Start your JVM with these arguments:

-Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=n

The address number is the port number the JVM will listen on for a debugger to attach to. Set suspend to y if you want the JVM to wait until a debugger is attached before starting main.

Your debugger should have the option to connect to a remote JVM. It should be a simple matter of punching in the host and port number.

Mike Daniels
  • 8,582
  • 2
  • 31
  • 44
1

I assume you mean a java app run from the CL by "core java"? If so

What are Java command line options to set to allow JVM to be remotely debugged?

Once you tell the jvm to listen on a port, just point your netbeans debugging profile to the machine ip and port. This should be very doable.

Community
  • 1
  • 1
hvgotcodes
  • 118,147
  • 33
  • 203
  • 236