From: http://blog.csdn.net/fyq891014/article/details/7534711
First of all, you need to have and deploy on the remote server to the project on the local eclipse, or debug will occur when the code line dislocation, difficult to achieve the effect of Debug. For example, if your local code adds lines, modifies, or cuts a line. While the project on the remote server does not change, the debug will find that the line number is wrong, or debug the value of the deviation, and so on.
1. Open Eclipse, click the Debug button in the upper left corner,
2. Click on the Red area
3. Double-click the red area
4.Project: Select the project you want to debug, Host: Enter your remote ip,port: Remote Call port. How to know the remote port by entering the command line of your remote virtual machine, entering the JPS-V command to find this line
-xrunjdwp:transport=dt_socket,server=y,address=52002,suspend=n
52002 is the calling interface for your remote virtual machine. If not, it is because your remote virtual machine tomacat or JBoss configuration does not support remote debugging, you need to add the following startup parameters to the JVM:
-xdebug-xrunjdwp:transport=dt_socket,address=52002,server=y,suspend=n
Adderss is your own set.
Set java_opts=-xdebug-xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n%JAVA_OPTS%
5. After everything is set up, click the Debug button in the lower right corner and you will be able to debug remotely like a local debug.
The PS:JPS (Java Virtual machine process Status Tool) is a command that JDK 1.5 provides to show all current Java process PID, and is simple and practical, ideal for linux/ Simple view of the current Java process on the UNIX platform.
Remote debug code with Eclipse (GO)