• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 304
  • Last Modified:

all source files are under src and libraries are in project class path

Hi,

I was reading as below

'all source files are under src and libraries are in project class path'

what is the meaning of above line and what is the importance of it. I do not have clear understanding on setting build path etc with or without eclipse.  How it is different if we use third party jars. please advise.
0
gudii9
Asked:
gudii9
  • 6
  • 4
1 Solution
 
girionisCommented:
In your project's structure you have several folders. The "src" folder is where the source files go while all the libraries go to "lib" folder. This folder is included in the classpath.
0
 
gudii9Author Commented:
"This folder is included in the classpath."

I have not understood this part very well. Esp how the eclpse does it. Like adding externl jars, internal jar, adding libraries. It is bit confusing. Some time projects work fine withough setting 'java build path' once i just copy jar to lib directory. Some times they do not work. Please advise.

Is setting classpath similar to setting JRE and JDK from my windlws laptop--->computer-->properties-->advanced properties-->set PATH/JAVA_HOME etc
0
 
gudii9Author Commented:
libraries go to "lib" folder. This folder is included in the classpath.

How to include lib folder with or without eclipse say for some simple J2EE project. please advise
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
girionisCommented:
In Eclipse it is included automatically, by default. When you build your project all the jars in the lib folder should be available. You shouldn't do anything else.
0
 
gudii9Author Commented:
But i remember doing multiple times manually adding to build path libraries in my previous projects. I wonder when i have to do that manual job when eclipse does automatically?

Do i need to refresh/clean/build/restart server etc for eclipse to do it automatically? Till then it wont reflect.  Say i have added new library(say xyz.jar) but the compilation errors due to missing xyz.jar will be there even after copying it to lib folder. so do i need to do all the steps like refresh/clean/build/restart server to reflect that jar to show up and clear compilation errors
0
 
girionisCommented:
I think if you have a web-application project then they are added automatically. If you have a standalone project then you need to add them manually.
0
 
gudii9Author Commented:
oh. Is there is a link which explains this subtle difference. Please advise
0
 
gudii9Author Commented:
How about EJB or web service projects. How it behaves?
0
 
gudii9Author Commented:
please advise
0
 
girionisCommented:
Not sure if there is a link, I know that with a web project all lib files are included since I have experienced it myself. With EJB or web services, it should be the same but I am not 100% sure. Why don't you try it yourself and see?
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now