在eclipse中的另一个项目中使用项目的包 [英] Using a project's package in another project in eclipse

查看:337
本文介绍了在eclipse中的另一个项目中使用项目的包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在已定义的主项目中使用包的类?
,例如,想象一下属于ProjectOne的包人员中有一个Employee类。让我们假设在另一个具有相同功能的项目(ProjectTwo)中需要Employee。我应该怎么做?

how can I use the classes of a package out of the main project where it has been defined? for example imagine there is an Employee class in package people which belongs to ProjectOne. let's assume Employee is needed in another project (ProjectTwo) with the same features.What should I do there?

推荐答案

右键单击在Project Explorer中的Package Explorer中。转到构建路径 - >配置构建路径。转到项目选项卡,单击添加,选择ProjectOne,然后单击确定,然后再次单击确定退出项目属性窗口。

Right-click on ProjectTwo in the Package Explorer. Go to Build Path -> Configure Build Path. Go to the Projects tab, click Add, select ProjectOne, and click OK, then click OK again to exit the project properties window.

然后像往常一样导入您的类ProjectTwo,您应该能够看到ProjectOne的类,就像他们在同一个项目中一样。

Then import your classes as usual - within ProjectTwo, you should be able to see ProjectOne's classes as if they were in the same project.

这篇关于在eclipse中的另一个项目中使用项目的包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆