title: java.lang.NullPointerException at org.eclipse.jface.resource.JFaceResources.getResources
body: <p>I am going to implement wizard with SWT / jface. When I run my program, I have the below error:</p>
  
  <pre><code>Exception in thread "main" java.lang.NullPointerException
  at org.eclipse.jface.resource.JFaceResources.getResources(JFaceResources.java:209)
  at org.eclipse.jface.resource.JFaceResources.getImageRegistry(JFaceResources.java:402)
  at org.eclipse.jface.wizard.Wizard.&lt;init&gt;(Wizard.java:105)
  at mypackage.ReservationWizard.&lt;init&gt;(ReservationWizard.java:21)
  at mypackage.ReservationWizard.main(ReservationWizard.java:69)
  </code></pre>
  
  <p>The part of my code:</p>
  
  <pre><code>public class ReservationWizard extends Wizard {
  
  **public ReservationWizard() {**
  
  //    setWindowTitle("Hotel room reservation wizard");
   //   setNeedsProgressMonitor(true);
   //  setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(null, "Unknown.jpg"));
  }
  ...
      public static void main(String[] args) {
   **ReservationWizard wizard = new ReservationWizard();**
   WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
  
   dialog.setBlockOnOpen(true);
      dialog.open();
   } 
  }
  </code></pre>
  
  <p>As seen in the code it has an error, even when the ReservationWizard() is empty. What should I do?</p>
  
  <p>It has an error on the specified lines.</p>
  
  <p><strong>edit:</strong>
  When I created a display, I have the below error:</p>
  
  <pre><code> at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
   at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
   at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
   at org.eclipse.jface.resource.JFaceResources.getFontRegistry(JFaceResources.java:340)
   at org.eclipse.jface.window.Window.createShell(Window.java:508)
   at org.eclipse.jface.window.Window.create(Window.java:429)
   at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1096)
   at org.eclipse.jface.window.Window.open(Window.java:792)
   at mypackage.ReservationWizard.main(ReservationWizard.java:76)
  Caused by: java.lang.ClassNotFoundException:    org.eclipse.core.commands.common.EventManager
   at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
   ... 30 more
  </code></pre>