title: Java and JFrame "NoClassDefFoundError"
body: <p>I am new to Java and especially to JFRAME. I am studying about basic game development and I created a simple class to output some graphics. Here is my code:</p>
  
  <pre><code>package jframedemo;
  import javax.swing.*;
  import java.awt.*;
  
  public class JFrameDemo extends JFrame {
      public JFrameDemo(){
          super("JFrameDemo");
          setSize(400,400);
          setVisible(true);
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     }    
  
      public void paint(Graphics g){
          super.paint(g);
          g.setColor(Color.WHITE);
          g.fillRect(0,0,400,400);
          g.setColor(Color.RED);
          g.setFont(new Font("Arial", Font.BOLD, 18));
          g.drawString("Doing graphics with JFrame!!", 60, 200);
      }
  
     public static void main(String[] args){
         new JFrameDemo();
      }
  }
  </code></pre>
  
  <p>Although during compile everything goes as well, when I try to execute  the programm I get the following error:</p>
  
  <p><strong>Exception in thread "main" java.lang.NoClassDefFoundError: JFrameDemo (wrong name: jframedemo/JFrameDemo)</strong></p>
  
  <p>I am working on Linux Mint 15 and my Java version is 1.7.0_25 OpenJDK Runtime Environment. Any suggestions why is this happening? </p>