Smashery
Smashery

Reputation: 59653

How to debug into dynamically-loaded jars in IntelliJ

I'm writing a plugin for ImageJ, with an Ant script to put all the needed files into a jar. ImageJ loads all the jars in a directory, and I run my plugin. However, when I try to debug my program, IntelliJ claims that there was "No Executable code found at line x in class y". How might I go about fixing this?

Upvotes: 0

Views: 2200

Answers (2)

CrazyCoder
CrazyCoder

Reputation: 401897

Double check that source code you build corresponds to the classes packaged in the jar, they must be synchronized. If you have a jar loaded that is built from the older sources it may cause such problem. Also ensure that you compile with debug info enabled. If compilation is performed from Ant, you must specify debug=true attribute for the javac Ant task.

If there is some obfuscation or bytecode manipulation involved in the Ant build, it may also cause issues when debugging.

Upvotes: 2

duffymo
duffymo

Reputation: 308743

I'm not sure, but you'll need the source code to see what you're debugging. Every time you add a JAR you also have the opportunity to tell IntelliJ where to find the source files that accompany it. See if you can do such a thing for your case.

Upvotes: 0

Related Questions