简体   繁体   中英

what is the difference between projects and libraries in eclipse's build path for any java project

We can add project as well as a jar file in java projects build path in eclipse. so what is the use of it?

Projects on the build path allow you to create dependencies between projects in the same workspace as well as use existing libraries via adding jars to the same path.

For example, I may create a project which defines data types that are common between a client and server project. If I am working on all three as separate projects, both will depend on the common data types.

If you add a project, you are adding a number of dependencies, among them is that the classpath of the added project is included into your project.

Adding a jar just adds that jar to the classpath.

It allows you to have separate projects that depend on each other and are developed in parallel. Any changes you make in one project are instantly visible to other projects that depend on it. If you used JAR files, then when the base project changes you'd first have to build its JAR file, put it into the dependent project's lib folder and rescan the folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM