JWhich in a line of code
Old skool java programmers will have almost certainly come across the tool JWhich (http://www.javaworld.com/javaworld/javatips/jw-javatip105.html). It's the classic tool for finding out which jar file contains a class. The following line of code has the same effect, and is slightly better than just trying to grep jar files.
com.ibm.websphere.management.AdminService.class. getClassLoader(). getResource( "com/ibm/websphere/management/AdminService.class");1
1 - after reading the source for JWhich I realised that I have just copied it exactly
↩