Remote debugging a Java application

前端 未结 6 1912
我在风中等你
我在风中等你 2020-11-22 07:24

I have a java application running on linux machine. I run the java application using the following:

java myapp -Xdebug -Xrunjdwp:server=y,transport=dt_socke         


        
6条回答
  •  滥情空心
    2020-11-22 08:12

    Answer covering Java >= 9:

    For Java 9+, the JVM option needs a slight change by prefixing the address with the IP address of the machine hosting the JVM, or just *:

    -agentlib:jdwp=transport=dt_socket,server=y,address=*:8000,suspend=n
    

    This is due to a change noted in https://www.oracle.com/technetwork/java/javase/9-notes-3745703.html#JDK-8041435.

    For Java < 9, the port number is enough to connect.

提交回复
热议问题