title: Check if class exists without running into ClassNotFoundException
body: <p>In order to schedule the execution of a job, i get the name of a class as a string-input.<br>
  This class may be in one of two packages, but i don't know which one so i have to check this.</p>
  
  <p>By now, i have two try-catch-blocks</p>
  
  <pre><code>Class&lt;Job&gt; clazz;
  String className; //the above mentioned string, will be initialized
  
  try {
      clazz = (Class&lt;Job&gt;) Class.forName("package.one." + className);
  } catch (ClassNotFoundException ex) {
      try {
          clazz = (Class&lt;Job&gt;) Class.forName("package.two." + className);
      } catch (ClassNotFoundException ex1) {
        //some error handling code here, as the class is
        //in neither of the two packages
      }
  }
  </code></pre>
  
  <p>For more packages this will get uglier and more unreadable. Furthermore, it is - for me - against the concept of exceptions, as exceptions should'nt be expected/used for flow-control!<br>
  Is there any way to rewrite this without the utilization of the <code>ClassNotFoundException</code>?</p>