users@glassfish.java.net

Load external libraries

From: <glassfish_at_javadesktop.org>
Date: Mon, 26 Apr 2010 15:05:49 PDT

Hello,
I have a problem that when creating jar, my main program won't find
import packages.
NoClassDefFoundError exception occurs:

java.lang.NoClassDefFoundError: javax/servlet/GenericServlet

Basically I have a dynamic web project, but I need to make a .jar
from a main program that needs to do some things before .war is made.
I manage to get things in .jar, but import statements fail.


Ant script:

    <target name="jar" depends="copy">
            <echo>Create jar</echo>

        <jar destfile="C:/project/build/program.jar">
            <manifest>
                 <attribute name="Main-Class" value="com.action.Main"/>
                 <attribute name="Class-Path" value=""/>
             </manifest>
            <fileset dir="C:/workspace/project/WEB-INF/classes"/>
            <fileset dir="C:/workspace/build/project/WEB-INF/classes"/>
              </jar>
    </target>

I hope you can help me, thanks.

Does anyone know how to load external libraries (I cant unzip official ones)?
[Message sent by forum member 'questioneverything']

http://forums.java.net/jive/thread.jspa?messageID=399135