1
votes

I have a jar file I want to debug in eclipse - using the options -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044. I have the sources for the jar file. However, I don't have an eclipse project.

In Windows C++ executables, I can connect to the running process using Windbg or Visual Studio as long as I have the pdb. I don't need to have the project/solution itself. I can open source files as needed and the Debugger automatically associates it with the process being debugged.

Is something like this not possible in Eclipse - it seems to want an Eclipse Project for connecting an debugging a process.

1

1 Answers

1
votes

I mainly see two options here:

  1. Forget your JVM parameters. Create a dummy Java project in Eclipse, reference your JAR file as library (via Java Build Path), create a Debug Configuration and specify the Main class of the JAR file as main class to run (you can find the Main class in the META-INF/MANIFEST.MF of the JAR).

You can attach your existing sources as source code attachment to the referenced JAR in Eclipse. (Google that if you need help with that).

  1. Execute the JAR as usual, with your JVM parameters mentioned. Use Eclipse's "Remote Java Application" Debug Configuration type to connect to the running application (yes, that still needs an empty dummy project). You can attach your external sources using the "Source" tab of the Debug Configuration.

Personally, I would prefer option 1.