开发者

Adding a reference between Eclipse Java projects

开发者 https://www.devze.com 2023-02-06 13:17 出处:网络
I have two Java projects in an Eclipse workspace, and I would like to use a class from one of them in the other.

I have two Java projects in an Eclipse workspace, and I would like to use a class from one of them in the other.

How can I add a reference between them? I'm looking for something lik开发者_如何学Goe adding a project reference in C#.


Assuming you are using Eclipse...

Right click the project -> Properties -> Java Build Path -> Projects tab

...which will allow you to force required projects on the project in questions build path.


I had the same problem but even after adding the project in the aforementioned way it still would not recognize the other project.

Turns out you must create a package, not use "default package" in the inner project, that fixed it.

0

精彩评论

暂无评论...
验证码 换一张
取 消