I have a very simple project here https://github.com/sherry-ummen/javadebuggingnotworking
I am trying to get remote debugging working because I need it to do it for a similar case so I thought of trying it out with a simple one.
I have put a break point at line 12. Did maven build to create the jar and also set the remote debugging configuration to this
And to start debugging I used the following command
java -Xdebug -Xrunjdwp:transport=dt_socket,address=8998,server=y -jar my-debug-test-0.0.1-SNAPSHOT.jar
Now when the process is listening , I go to IntelliJ and press remote debugging configuration then I get the following message on the Intellij output window without hitting the breakpoint.
Connected to the target VM, address: 'localhost:8998', transport: 'socket'
Disconnected from the target VM, address: 'localhost:8998', transport: 'socket'
And also in the console window where I started the java process gets stopped with the following message
C:\Users\sherry.ummen\eclipse-workspace\my-debug-test\target>java -Xdebug -
Xrunjdwp:transport=dt_socket,address=8998,server=y -jar my-debug-test-0.0.1-
Listening for transport dt_socket at address: 8998
no main manifest attribute, in my-debug-test-0.0.1-SNAPSHOT.jar
in your case IDEA or Eclipse has successfully connected to the process. problem is , in your jar there no defined main class (should be defined in the manifest). so java process will be immediately stop because it has no main class to run.
in the jar , META-INF filder, there should be a file names MANIFEST.MF, in that file there should be a entry like this