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

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.