Eclipse - 如何在项目之间赋予依赖关系?

Eclipse - How to give dependency between projects?(Eclipse - 如何在项目之间赋予依赖关系?)
本文介绍了Eclipse - 如何在项目之间赋予依赖关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

提前致谢.

推荐答案

如果您想将您的第二个项目与您的第一个项目链接,请不要将第一个项目以 JAR 文件的形式添加到第二个项目.

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.

打开第二个项目的项目属性并选择Java Build Path".在Projects"选项卡的右侧,您可以将您的第一个项目添加为构建路径上的必需项目".

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".

项目 1 的类文件现在已添加到项目 2 的类路径中.如果单击类名,您将直接进入源代码.

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 - 如何在项目之间赋予依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

VertX 3.9.7 when i receive the form quot;throw exceptionquot; Size exceed allowed maximum capacityquot;(VertX 3.9.7收到表单时抛出异常SIZE超出允许的最大容量QUOT;)
JDK11 Upgrade Fails - ClassNotFoundException jdk.internal.ref.Cleaner(JDK11升级失败-ClassNotFoundException jdk.inder.ref.Cleaner)
How to make Eclipse compile patched modules on JDK 9+ by passing the --patch-module javac option to my project compiler? (see pic)(如何通过向我的项目编译器传递--patch-MODULE javac选项,让Eclipse在JDK 9+上编译打了补丁的模块?(见图))
JavaFX Modular Application, java.lang.module.FindException: Module javafx.controls not found (Java 11, Intellij)(JavaFX模块化应用程序,java.lang.mode.FindException:未找到模块javafx.Controls(Java 11,IntelliJ))
Returning NumberFormatException form SimpleDateFormat in Java code(在Java代码中返回SimpleDateFormat形式的NumberFormatException)
SimpleDateFormat() not giving IllegalArgumentException on passing invalid date format(SimpleDateFormat()在传递无效的日期格式时未给出IlLegalArgumentException)