title: NoClassDefFoundError on Non-static class with private constructor
body: <p>I have a Java class that has a private constructor:</p>
  
  <pre><code>public class MyClass {
    private static final MyClass myClass = new MyClass();
  
    private MyClass() {}
  
    public static MyClass getInstance() {
      return myClass;
    }
  }
  </code></pre>
  
  <p>This class is being used in the application like this:</p>
  
  <pre><code>MyClass myClass = MyClass.getInstance();
  </code></pre>
  
  <p>The whole application is also exported as a JAR and used in another application.</p>
  
  <p>When I try to do the same in another application (Where its being invoked from a JAR) I get the following error:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: Could not initialize class com.example.MyClass
  </code></pre>
  
  <p>I am not sure if this is the required behavior for a class with a <strong><em>private constructor</em></strong>, or is there something else wrong with it?</p>
  
  <p>Thanks!</p>