Eclipse - 如何赋予项目依赖性? [英] Eclipse - How to give dependency between projects?

查看:105
本文介绍了Eclipse - 如何赋予项目依赖性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Eclipse中有两个java项目。第二个是使用第一个罐子。当我尝试从第二个课程导航到第一个课程时,它将打开该文件的 .class 。但是我想打开第一个项目文件。请帮助。



提前感谢

解决方案

要将您的第二个项目与您的第一个项目关联,请勿将第一个项目以JAR文件的形式添加到第二个。



而是打开项目属性,然后选择 Java Build Path 。在项目标签的右侧,您可以将第一个项目添加到构建路径上的所需项目。



该类项目1的文件现在被添加到项目2的类路径中。如果您点击类名,直接得到源代码。


I have two java projects in eclipse. Second one is using first one's jar. When I try to navigate to first one's class from second one, it opens .class of that file. But I want to open the first one project file. Please help.

Thanks in advance.

解决方案

If you want to link your second project with your first project, don't add the first project in form of a JAR file to the second.

Instead open the project properties of the second project and select "Java Build Path". On the right side on the "Projects" tab you can add your first project as "required project on the build path".

The class files of project 1 are now added to the class path of project 2. And if you click on a class name you directly get to the source code.

这篇关于Eclipse - 如何赋予项目依赖性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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