Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging Java Application Over Network

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

like image 664
Kamiikoneko Avatar asked Jan 22 '23 18:01

Kamiikoneko


1 Answers

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.

like image 82
Mike Daniels Avatar answered Feb 01 '23 23:02

Mike Daniels