Code on eclipse remote debug server

Actually I'm real 2022-09-23 10:18:24 阅读数:270


1. First make the java maven project into a jar, and then put it on the server.

2. Then edit the start command as follows.

classpath=`find -name "*.jar"|xargs|sed "s/ /:/g"`

java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n-Xms256m -Xms512m -classpath ${classpath}  com.kora.bcserver.BCS>./box-controller-server.log 2>&1

The red mark is the port during remote debugging, and the blue mark is the class of my main function.

3. After starting the project through the startup item.Right-click on your main function program.

Debug Configurations--->Remote Java Application--->Right click New--->Project to select your project, Host fill in the server, Port fill in the port above, hereMine is 8787.

After that, click Debug. If the BCS program on the server is running, it will enter the debug normally. At this time, as long as you interrupt the power in your own program,When the program on the server runs to that short point, debugging can be started.

copyright:author[Actually I'm real],Please bring the original link to reprint, thank you.