JWhich in a line of code

Published by Rob on August 20th, 2008 - in Java

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 :)

Related posts:

  1. Why Use a Sledgehammer When There is a Bulldozer Lying Around
  2. Command line zip in windows – Working in Windows Series 1
  3. Looking for TDD Swing code
  4. Programmatic Check for WebSphere Portal iFixes and Fixpacks
  5. TestDox IntelliJ Plugin Reviewed

One Response

  1. [...] beauty buys: clarins multi-active night cream First saved by KrazySteph14 | 14 days ago JWhich in a line of code First saved by kamiyra | 14 days ago Danger Daily News 8-31-08 First saved by SarahKate | 14 [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© Rob@Rojotek