title: How can I get Class object for every class in a jar
body: <p>I have a jar file with 30 or so classes. What I want is that at the beginning of the main method I invoke a class from within this jar which using Java's reflection capabilities gets <code>Class</code> references to each class in the jar. My ultimate goal is to perform some sort of operation, querying a variable which is defined for every class. Basically I'm looking for something like. Is there an easy way to do this using the standard reflection APIs or it will be too much of a hassle to make a working solution? </p>
  
  <pre><code>List l = Reflection.getAllClasses();
  String var;
  foreach(Class c : l) { 
      var = c.getField("fieldname");
      doSomething(var);
  }
  </code></pre>
  
  <p>Edit:</p>
  
  <p>Just to make it clear: The code will be executed from withing the inspected jar.</p>