简体   繁体   English

在任何java项目的eclipse构建路径中,项目和库之间有什么区别

[英]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. 我们可以在eclipse中的java项目构建路径中添加项目和jar文件。 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. 构建路径上的项目允许您在同一工作空间中的项目之间创建依赖关系,以及通过将jar添加到同一路径来使用现有库。

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. 添加jar只是将jar添加到类路径中。

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. 如果您使用了JAR文件,那么当基础项目发生更改时,您首先必须构建其JAR文件,将其放入依赖项目的lib文件夹并重新扫描该文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Eclipse动态Web项目IDE中的“Java Build Path”和“Deployment assembly”有什么区别? - What is the difference between “Java Build Path” and “Deployment assembly” in Eclipse dynamic web project IDE? 在eclipse中设置classpath和java build path有什么区别? - What is the difference between setting the classpath and java build path in eclipse? Maven项目与Eclipse中其他项目之间的区别 - Difference between maven project and other projects in Eclipse Eclipse中的“ Java Project”和“ Project”选项有什么区别? - What is the difference between the “Java Project” and “Project” options in Eclipse? 在Eclipse中的Java构建路径中拥有另一个项目的等价物是什么? - What's the gradle equivalent of having another project in your Java build path in Eclipse? Java构建路径中缺少项目 - 项目设置 - Missing Project in the Java Build Path - Projects settings 类路径和构建路径有什么区别 - What is the difference between Class Path and Build Path `Eclipse / Project / Clean ...`和`Eclipse / Project / Refresh(F5)`有什么区别? - What's the difference between `Eclipse/Project/Clean…` and `Eclipse/Project/Refresh (F5)`? Hudson和CruiseControl对Java项目有什么区别? - What is the difference between Hudson and CruiseControl for Java projects? IDEA:Build 和 Build Project 有什么区别? - IDEA: what is the difference between Build and Build Project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM