views:

30

answers:

2

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

A: 

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

http://stackoverflow.com/questions/138511/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.

hvgotcodes
+2  A: 

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
Thank you. Yes the option is there and I found that, the JVM args are what I was unaware of.Thank you again.
Kamiikoneko