This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Why do we need to set the buildpath of the jar files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Why do we need to set the buildpath of the jar files" Watch "Why do we need to set the buildpath of the jar files" New topic
Author

Why do we need to set the buildpath of the jar files

Mathew Lee
Ranch Hand

Joined: Jun 08, 2009
Posts: 238
: I am developing 'StrutsEx'named struts application in RAD7.0. I have all the required jar files like



struts2-core-2.0.11.2.jar

ognl-2.6.11.jar

commons-logging-1.0.4.jar

freemarker-2.3.8.jar

xwork-2.0.5.jar

within StrutsEx\WEB-INF\lib.

I saw lot compilation errors earlier. But later when I add above mentioned jar files by right clicking on project--->properties--->java build path--->add external jars--- then the compilation issues were resolved. My question why we need to add those files separately like

project--->properties--->java build path--->add external jars

eventhough those jar files are already present within the lib folder of the project.
Theodore Casser
Ranch Hand

Joined: Mar 14, 2001
Posts: 1902

You might be better off asking this question in the IDE forum.

The very basic answer, though, is that the JARS need to be in the classpath of the compiler when you're building your application, and RAD pulls it from where you specify in that dialogue box. (I don't claim to be an expert on RAD, though.)


Theodore Jonathan Casser
SCJP/SCSNI/SCBCD/SCWCD/SCDJWS/SCMAD/SCEA/MCTS/MCPD... and so many more letters than you can shake a stick at!
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Theodore Casser wrote:You might be better off asking this question in the IDE forum.

And moved.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Michael Angstadt
Ranch Hand

Joined: Jun 17, 2009
Posts: 273

When you create a classpath, you have to include the path to every single JAR file you're using...even if they are all in the same directory (i.e. it won't let you do something like "foo/bar/*.jar"). That's probably why you had to add each JAR separately...but yeah, sounds more like an IDE issue, since it should take care of that for you.


SCJP 6 || SCWCD 5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why do we need to set the buildpath of the jar files
 
Similar Threads
Eclipse IDE and jars
ECLIPSE ...or any other IDE
Servlet jar file problem--where will i get jar file
hi, setting .jar file in eclipse
jar files not detecting