This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Not so clear on where the jar files go Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Not so clear on where the jar files go" Watch "Not so clear on where the jar files go" New topic
Author

Not so clear on where the jar files go

Thomas Kennedy
Ranch Hand

Joined: Jan 20, 2008
Posts: 137
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?

Costs matter. Justice lies in processes not outcomes. Crime is caused by criminals.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Not so clear on where the jar files go
 
Similar Threads
STRUTS 2 "package com.opensymphony.xwork2" does not exist
dtd not found
Struts 2 - Error while accessing struts-tlds
Working with struts in FF3.5
Unexpected error when running application from tomcat.