You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by sandyg <ga...@gmail.com> on 2008/03/07 13:08:13 UTC

how to get jars scope in to my application

I am creating an jar executable file using ant

<jar destfile="dist/searchengine.jar" basedir="${build_classes}">
 		            <manifest>
 		                <attribute name="Main-Class" value="com.Test"/>
 		            </manifest>
 		        </jar>
 		
 		<!-- to run th jar file-->
 		
 			<echo message="to run th jar file ..."/>
 		        <java jar="dist/searchengine.jar" fork="true"/>


but i am getting the Exception in thread "main"
java.lang.NoClassDefFoundError: javax/servlet/ServletException

even all jars were in the classes folder of my jar
can anybody help me please how to get the jar file scope

-- 
View this message in context: http://www.nabble.com/how-to-get-jars-scope-in-to-my-application-tp15891190p15891190.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: how to get jars scope in to my application

Posted by Steve Loughran <st...@apache.org>.
sandyg wrote:
> I am creating an jar executable file using ant
> 
> <jar destfile="dist/searchengine.jar" basedir="${build_classes}">
>  		            <manifest>
>  		                <attribute name="Main-Class" value="com.Test"/>
>  		            </manifest>
>  		        </jar>
>  		
>  		<!-- to run th jar file-->
>  		
>  			<echo message="to run th jar file ..."/>
>  		        <java jar="dist/searchengine.jar" fork="true"/>
> 
> 
> but i am getting the Exception in thread "main"
> java.lang.NoClassDefFoundError: javax/servlet/ServletException
> 
> even all jars were in the classes folder of my jar
> can anybody help me please how to get the jar file scope
> 

You need to add the path to the manifest file of all the JARs you want 
to run. Part of Sun's rules. I'm afraid.

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org