开发者

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

We can add project as开发者_StackOverflow社区 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜