File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Mathew Lee
Ranch Hand
Posts: 238
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
: 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
Posts: 1902
Hibernate Netbeans IDE PHP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
Rob Spoor
Sheriff
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Theodore Casser wrote:You might be better off asking this question in the IDE forum.

And moved.
 
Michael Angstadt
Ranch Hand
Posts: 277
Eclipse IDE Java PHP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic