aspose file tools*
The moose likes Struts and the fly likes Setting the classpath to struts jars to compile my actions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Setting the classpath to struts jars to compile my actions" Watch "Setting the classpath to struts jars to compile my actions" New topic
Author

Setting the classpath to struts jars to compile my actions

Priety Sharma
Ranch Hand

Joined: Jun 10, 2008
Posts: 156

Hi,

I am trying to compile a class in a sample struts application I have deployed on Tomcat5.5.

I am trying to set the classpath to all the jars required for my action class in the lib folder.
The path to the lib foler is c:\Apache Software Foundation\Tomcat 5.5\webapps\Struts2InAction\WEB-INF\lib\

I set the classpath to one of my jars as follows:
set CLASSPATH=.;c:\Apache Software Foundation\Tomcat 5.5\webapps\Struts2InAction\WEB-INF\lib\struts2-core-2.0.11.jar

I tried to compile one of my action class after doing this and the number of errors went down.
There are several jars in the lib folder.

I want to set my classpath to point to all these jars.
There are too many jars. In total there are 42jars.
So do I have to keep appending the entire path to the jar file followed by the jar for 42 times.
e.g.
set CLASSPATH=.;c:\Apache Software Foundation\Tomcat 5.5\webapps\Struts2InAction\WEB-INF\lib\struts2-core-2.0.11.jar;c:\Apache Software Foundation\Tomcat 5.5\webapps\Struts2InAction\WEB-INF\lib\xwork-2.0.4.jar and so on for 42 times.

Is there a simpler way to do this? All the jars are in the same location.

Priety.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

I follow the Tomcat Application Developer's Guide on how to configure and build web apps. That guide uses Ant to do builds. Maven is another popular build tool. Both have tools that greatly simplify common build tasks,such as managing dependencies.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
jQuery in Action, 2nd edition
 
subject: Setting the classpath to struts jars to compile my actions