开发者

Adding a reference between Eclipse Java projects

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜