title: java.lang.NoClassDefFoundError: org/jboss/netty/channel/ChannelFactory
body: <p>I'm making an app with Netty and ant. When I compile it, there is no error. But when I try to run the jar file, it gets these message:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/netty/channel/ChannelFactory
  Caused by: java.lang.ClassNotFoundException: org.jboss.netty.channel.ChannelFactory
          at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
  Could not find the main class: org.darkquest.gs.Server. Program will exit.
  </code></pre>
  
  <p>This is my build.xml my project:</p>
  
  <pre><code>&lt;project default="compile" basedir="."&gt;
  
          &lt;property name="src" location="src" /&gt;
          &lt;property name="build" location="build" /&gt;
          &lt;property name="doc" location="doc" /&gt;
          &lt;property name="lib" location="lib" /&gt;
          &lt;property name="jar" location="runescape.jar" /&gt;
  
          &lt;target name="compile"&gt;
                  &lt;delete file="${jar}" /&gt;
                  &lt;delete dir="${build}" /&gt;
                  &lt;mkdir dir="${build}"/&gt;
                  &lt;javac srcdir="${src}" destdir="${build}" debug="on"&gt;
                    &lt;compilerarg value="-Xlint:unchecked"/&gt;
                    &lt;classpath&gt;
                          &lt;pathelement location="${lib}/mina.jar" /&gt;
                          &lt;pathelement location="${lib}/netty.jar" /&gt;
                          &lt;pathelement location="${lib}/xpp3.jar" /&gt;
                          &lt;pathelement location="${lib}/slf4j.jar"/&gt;
                          &lt;pathelement location="${lib}/xstream.jar"/&gt;
                          &lt;pathelement location="${lib}/mysql-connector.jar" /&gt;
                          &lt;pathelement location="${lib}/hex-string.jar" /&gt;
                          &lt;pathelement path="${java.class.path}/"/&gt;
                    &lt;/classpath&gt;
                  &lt;/javac&gt;
                  &lt;jar basedir="${build}" destfile="${jar}" &gt;
                          &lt;manifest&gt;
                                  &lt;attribute name="Main-Class" value="org.darkquest.gs.Server" /&gt;
                          &lt;/manifest&gt;
                  &lt;/jar&gt;
          &lt;/target&gt;
  
          &lt;target name="doc" depends="compile"&gt;
                  &lt;javadoc sourcepath="${src}" destdir="${doc}" verbose="on" /&gt;
          &lt;/target&gt;
  
          &lt;target name="runls"&gt;
                  &lt;java classname="org.darkquest.ls.Server" fork="true"&gt;
                          &lt;jvmarg value="-Xms128m" /&gt;
                          &lt;jvmarg value="-Xmx512m" /&gt;
                          &lt;arg value="ls.conf" /&gt;
                          &lt;classpath&gt;
                                  &lt;pathelement location="${lib}/mina.jar" /&gt;
                                  &lt;pathelement location="${lib}/netty.jar" /&gt;
                                  &lt;pathelement location="${lib}/xpp3.jar" /&gt;
                                  &lt;pathelement location="${lib}/slf4j.jar"/&gt;
                                  &lt;pathelement location="${lib}/xstream.jar"/&gt;
                                  &lt;pathelement location="${lib}/mysql-connector.jar" /&gt;
                                  &lt;pathelement location="${lib}/hex-string.jar" /&gt;
                                  &lt;pathelement path="${jar}/" /&gt;
                          &lt;/classpath&gt;
                  &lt;/java&gt;
          &lt;/target&gt;
  
          &lt;target name="runserver"&gt;
                  &lt;java classname="org.darkquest.gs.Server" fork="true"&gt;
                          &lt;jvmarg value="-Xms128m" /&gt;
                          &lt;jvmarg value="-Xmx512m" /&gt;
                          &lt;arg value="server.conf" /&gt;
                          &lt;arg value="f2p" /&gt;
                          &lt;arg value="no" /&gt;
                          &lt;classpath&gt;
                                  &lt;pathelement location="${lib}/mina.jar" /&gt;
                                  &lt;pathelement location="${lib}/xpp3.jar" /&gt;
                                  &lt;pathelement location="${lib}/netty.jar" /&gt;
                                  &lt;pathelement location="${lib}/slf4j.jar"/&gt;
                                  &lt;pathelement location="${lib}/xstream.jar"/&gt;
                                  &lt;pathelement location="${lib}/mysql-connector.jar" /&gt;
                                  &lt;pathelement location="${lib}/hex-string.jar" /&gt;
                                  &lt;pathelement path="${jar}/" /&gt;
                          &lt;/classpath&gt;
                  &lt;/java&gt;
          &lt;/target&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>And these are the jars of the netty library:</p>
  
  <pre><code>ls -la /usr/share/java/netty*
  -rw-r--r-- 1 root root 1118026 2012-06-24 15:29 /usr/share/java/netty-3.5.1.Final.jar
  lrwxrwxrwx 1 root root      37 2012-07-02 01:31 /usr/share/java/netty.jar -&gt; /usr/share/java/netty-3.5.1.Final.jar
  ls -la lib/
  total 4904
  drwxrwxrwx 1 user user    4096 2012-07-02 01:49 .
  drwxr-xr-x 1 user user    4096 2012-07-02 02:21 ..
  -rw-rw-rw- 1 user user  281694 2012-06-18 05:43 bsh.jar
  -rw-r--r-- 1 user user    6148 2012-06-18 05:48 .DS_Store
  -rw-rw-rw- 1 user user    1685 2012-06-18 05:43 hex-string.jar
  -rw-rw-rw- 1 user user 2082557 2012-06-18 05:43 jmf.jar
  -rw-rw-rw- 1 user user  112249 2012-06-18 05:43 junit.jar
  -rw-r----- 1 user user  315582 2012-07-01 15:21 mina-core-1.1.7.jar
  -rw-rw-rw- 1 user user  315582 2012-06-18 05:43 mina.jar
  -rw-rw-rw- 1 user user  456729 2012-06-18 05:43 mysql-connector.jar
  -rw-rw-rw- 1 user user 1118026 2012-07-02 01:49 netty.jar
  -rw-rw-rw- 1 user user   13873 2012-06-18 05:43 slf4j.jar
  -rw-rw-rw- 1 user user   24538 2012-06-18 05:43 xpp3.jar
  -rw-rw-rw- 1 user user  261710 2012-06-18 05:43 xstream.jar
  </code></pre>
  
  <p>Anyone can help me?</p>
  
  <p>Thanks.</p>