Adding a reference between Eclipse Java projects

后端 未结 2 560
暖寄归人
暖寄归人 2020-12-07 00:22

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

相关标签:
2条回答
  • 2020-12-07 00:56

    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 讨论(0)
  • 2020-12-07 01:01

    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.

    0 讨论(0)
提交回复
热议问题