Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting the classpath to struts jars to compile my actions

 
Priety Sharma
Ranch Hand
Posts: 156
Android Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic