Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not so clear on where the jar files go

 
Thomas Kennedy
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a large number of jar files in the Struts 2 download. Some of these -- the struts core, the xwork core and a couple of others -- are used by the project I'm trying to compile. I'm a little unclear on where these go:

1. Should I add struts2-core-2.1.8.1.jar and xwork-core-2.1.6.jar and whatever else the compiler needs to the system's lib folder? Is there any reason not to do this?

1a. Is there a better way, one that does not involve putting things in the system classpath? I'm compiling at the command line - no IDE.

2. There is a .classpath file in the project's root, something I have not seen before. Is it correct to say that this .classpath file sets the project's classpath at runtime, and that I should put the jars I actually need under WEB-INF\lib and list them in this file?

2a. What is the relationship between this file and the system classpath when my app runs?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Should I add struts2-core-2.1.8.1.jar and xwork-core-2.1.6.jar and whatever else the compiler needs to the system's lib folder?

No.

Is there any reason not to do this?

Yes.

1a. Is there a better way, one that does not involve putting things in the system classpath? I'm compiling at the command line - no IDE.

Yes--put them in the web app's WEB-INF/lib directory, where they belong. (Unless you're using Maven, in which case don't, and use Maven to build.)

2. There is a .classpath file in the project's root, something I have not seen before. Is it correct to say that this .classpath file sets the project's classpath at runtime, and that I should put the jars I actually need under WEB-INF\lib and list them in this file?

No. ".classpath" is an Eclipse artifact. Don't edit it manually.

2a. What is the relationship between this file and the system classpath when my app runs?

No relationship whatsoever.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic