title: Why am I getting a NoClassDefFoundError from org/jfree/chart?
body: <p>I am trying to make a simple applet that displays a 3D pie chart, but am getting a</p>
  
  <pre><code>RuntimeException (`java.lang.NoClassDefFoundError: org/jfree/chart/ChartPanel`)
  </code></pre>
  
  <p>I've been running in circles trying to find out why, thinking that it may be a problem with the applet being able to read the 3rd party libraries I used.  It works fine in NetBeans, but in the browser I keep getting the error.  Any clue what I did wrong?  Code below:</p>
  
  <p>HTML:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;APPLET codebase="classes" code="CyberThreatApplet/CyberThreatApplet.class" 
      archive="jfreechart-1.0.19.jar,jcommon-1.0.23.jar" width=350 height=200&gt;
  &lt;/APPLET&gt;
  </code></pre>
  
  <p>Java:</p>
  
  <pre><code>package CyberThreatApplet;
  
  import java.awt.Dimension;
  import javax.swing.JApplet;
  import org.jfree.chart.*;
  import org.jfree.chart.plot.PiePlot3D;
  import org.jfree.data.general.*;
  import org.jfree.util.Rotation;
  
  public class CyberThreatApplet extends JApplet
  
  {
  
  @Override
  public void init()
  {
      CreateChart("Cyber Attack Pie Chart","Motivations Behind Cyber Attacks - May 2013");
  }
  
  private void CreateChart(String appTitle, String chartTitle)
  
  {
      PieDataset dataset = createDataset();
      JFreeChart chart = createChart(dataset,chartTitle);
      ChartPanel chartPanel = new ChartPanel(chart);
      chartPanel.setPreferredSize(new Dimension(500,300));
      add(chartPanel);
  }
  
  private PieDataset createDataset()
  
  {
      DefaultPieDataset result = new DefaultPieDataset();
      result.setValue("Cybercrime",46);
      result.setValue("Hacktivism",36);
      result.setValue("Cyber Espionage",9);
      result.setValue("Cyber Warfare",9);
      return result;
  }
  
  private JFreeChart createChart(PieDataset dataset,String title)
  
  {
      JFreeChart chart = ChartFactory.createPieChart3D(title,dataset,true,true,false);
      PiePlot3D plot = (PiePlot3D)chart.getPlot();
      plot.setStartAngle(90);
      plot.setDirection(Rotation.CLOCKWISE);
      plot.setForegroundAlpha(0.75f);
      return chart;
  }
  
  }
  </code></pre>