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.
精彩评论