Jon
Jon

Reputation: 5357

Overriding the debug classpath in IntelliJ when using custom ClassLoaders

I'm debugging a project in IntelliJ which uses multiple ClassLoaders. I have a number of libraries included as JARs which are used for compilation. When I debug I want to start the JVM with no classpath since my dependencies are loaded by my customized ClassLoaders.

But IntelliJ automatically builds the default classpath and passes this to the JVM. I can't find a way to override this behaviour. Is it possible to force a debug configuration which starts with an empty classpath?

Thanks, Jon

Upvotes: 0

Views: 2551

Answers (2)

Yishai
Yishai

Reputation: 91881

In the run configuration, you can change the "Use Classpath and dependencies of Module" to no module, but that won't solve this particular problem.

I think you need a bootstrap module that has just the code that is needed to start up the environment and get to the point where your classloaders get involved, and whatever dependencies that code has, and then run the debug from that module. I'm not 100% sure that the debugger will realize that the classes belong to the source code that it knows about, but that would be my first try.

Upvotes: 0

CrazyCoder
CrazyCoder

Reputation: 402055

Possible, create a dummy module with no extra classpath elements and in the Run/Debug configuration specify this module to use the classpath of.

Upvotes: 4

Related Questions