从eclipse中的另一个java项目导入

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3487585/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 01:14:07  来源:igfitidea点击:

import from another java project in eclipse

javaeclipseimport

提问by David B

I'm working on two projects in eclipse and I would like to import some classes from project a to project b. What should I do?

我正在 eclipse 中处理两个项目,我想将一些类从项目 a 导入到项目 b。我该怎么办?

Is there a way of doing it without adding the project to the build path ?

有没有办法在不将项目添加到构建路径的情况下做到这一点?

采纳答案by ozk

add project A to project B's build path.

将项目 A 添加到项目 B 的构建路径。

Follow these steps:
Edits by @David B
Right click on project B's folder in eclipse --> properties --> build path --> projects --> add.
Now add project A

遵循以下步骤:
通过@David B
右键单击 eclipse 中项目 B 的文件夹进行编辑--> 属性 --> 构建路径 --> 项目 --> 添加。
现在添加项目A