Home >Java >javaTutorial >How Can I Remotely Debug Java Programs Using Command-Line Options?
Java Command-Line Options for Remote Debugging
Java provides options to enable remote debugging of Java programs through the Java Virtual Machine (JVM). To remotely debug, specific command-line options need to be set.
Command-Line Options Before Java 5.0
Prior to Java 5.0, two options were used:
Command-Line Options from Java 5.0
From Java 5.0 onwards, it's recommended to use the following single option:
-agentlib:jdwp Options
The options for -agentlib:jdwp are as follows:
Example
To remotely debug a Java program running on a distant computer:
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 MyProgram
The above is the detailed content of How Can I Remotely Debug Java Programs Using Command-Line Options?. For more information, please follow other related articles on the PHP Chinese website!