Here i will show you how to do it in a few steps; lets say you have a JAR file called "application.jar":
Start the application enabling remote debbuging:
Start the application with the following command.This command starts a server socket at port 8998 and broadcasts the debugging messages using JDWP (Java Debug Wire Protocol).
Configure Eclipse
- Go to Run -> Debug Configurations
- Create a Remote java Application
- Configure the details:
- Connection Type: Standard
- Host: Server of the remote app
- Port: Chosen when launching the jar (8998 in this example).
- Check "Allow termination of remote VM"
- Check Common->Debug if you want it on your favorites menu.
Click "apply" and...voi-la! you can now debug your application by launching this configuration!