title: NoClassDefFoundError for inner class
body: <p>So, I've discovered that this is a very common problem for new Java programmers. Yet today is the first time I've run into it, after eight months of programming in Java.</p>
  
  <p>This program has been working perfectly well for quite some time now. I made a minor tweak to the Swing layout last night and finally had a chance to give it a try this morning when I got that error. The tweak I made <em>could</em> un-made, but I am fairly certain it is unrelated to this error.</p>
  
  <p>The error tells me that it occurs at the line:</p>
  
  <pre><code>private CheckTreeTableSelectionListener selectionListener = new CheckTreeTableSelectionListener();
  </code></pre>
  
  <p>which resides in the field list at the top of the class. Here's the interesting bit: <code>CheckTreeTableSelectionListener</code> is <em><strong>an inner class</strong></em>. It is <em>not</em> external nor being imported. Also, I <em>did not touch</em> that inner class last night, nor did I touch the field that creates a new instance of it. Now I understand (barely) that the NoClassDefFoundError message means that the class definition could be found at compile-time, but not at runtime. This does not really help. If it is an inner class, how can it not be found? It's right there, inside the class that instantiates it!</p>
  
  <h2>Edit</h2>
  
  <p>As requested, here is the stacktrace:</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: info/chrismcgee/sky/Scheduling$CheckTreeTableSelectionListener
  at info.chrismcgee.sky.Scheduling.&lt;init&gt;(Scheduling.java:165)
  at info.chrismcgee.sky.Scheduling$2.run(Scheduling.java:204)
  at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
  at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744)
  at java.awt.EventQueue.access$400(EventQueue.java:97)
  at java.awt.EventQueue$3.run(EventQueue.java:697)
  at java.awt.EventQueue$3.run(EventQueue.java:691)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
  at java.awt.EventQueue.dispatchEvent(EventQueue.java:714)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
  at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
  at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
  Caused by: java.lang.ClassNotFoundException: info.chrismcgee.sky.Scheduling$CheckTreeTableSelectionListener
  at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  ... 16 more
  </code></pre>