1. Run the application in command line.
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8888 \ -jar whatever.jarThe suspend=y means that the application will be suspended until the debugger has been attached to it.
2. In Eclipse, click 'Debug Configuration' in the Debug icon. Go to 'Remote Java Application' and specify the project that we want to debug, the connection (Socket Attach), hostname, and port number.
In NetBeans, click on 'Attach Debugger' and specify the connection type (SocketAttach), hostname, and port number.
No comments:
Post a Comment