Friday 31 August 2012

So which Jar is that class actually in?

When you can't find the JAR that a particular class is in it can be a frustrating experience.
Next time try this code snipit:

    URL url = Dodgy.class.getProtectionDomain().getCodeSource().getLocation();
    logger.debug(url.toString());

Now you should be able to tell where the offending class is!