Debugging Java applications over the network

I have a main Java application running on a computer on my network. Can I connect a debugger (preferred netbeans) to this from another computer on the same network?

Please tell me how to do this, if possible, or indicate to me an article in which I had a terrible time to search. I do not understand why this should not be possible.

thanks

+4
source share
2 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 that the JVM will listen to connect to the debugger. Set suspend to y if you want the JVM to wait until the debugger is attached before running main .

The debugger must be able to connect to the remote JVM. This should be a simple matter of punching the host number and port.

+8
source

I assume that you mean the java application launched from CL by means of "core java"? If so

What are the Java command line options for remotely debugging the JVM?

Once you tell jvm to listen on the port, just specify the netbeans debug profile on the ip and device port. This should be very doable.

+1
source

Source: https://habr.com/ru/post/1315856/


All Articles