Run/debug with dynamic.classpath=true does not activate JMockit coverage


I always appreciated what IDEA prints as the first line of the console output when you run/debug your application, or even tests. For whatever reason something switched dynamic.classpath to true (not sure what does it, maybe some plugin?) and it stopped doing it, I understand the reasoning behind it (safer for possibly too long classpaths, etc.), although I miss the output and the file mentioned in the command line (e.g. `C:\Users\Virgo\AppData\Local\Temp\classpath2.tmp`) is already gone when I want to check its content. I just put classpath printing it into my application, and I'm fine.

However, this method obviously affects some other tools. I wasn't able to enable jmockit-coverate, although I clearly had it on the classpath. I moved on, but to my surprise, when I ran some test on different computer, it started producing the coverage output! Running the test also printed the whole classpath on the first line. That's when I started to dig deeper to find out what causes this (posts like, but there are others).

What may be the difference causing jmockit-coverage not getting activated in the case of dynamic.classpath?




Hi Richard,

what IDEA version do you use? IDEA 14.1 and IDEA 15 behave differently. For IDEA 14.1 there was an issue in the tracker about wrong classloaders and JMockit, so please try IDEA 15 if not already checked. IDEA 15 uses classpath.jar which references classpath via Class-Path attribute of the manifest. It is free from classloaders problems but some of the frameworks do not support it (though it's an Oracle official way to pass too long classpath on Win). If it is the case, please provide more details in YouTrack ticket.



Hi Anna :-)

I was using production version (14.1.5), but you're right, with 15 preview this works even with dynamic classpath. Way to go.

Thank you very much for the suggestion