How to link project in eclipse

时光怂恿深爱的人放手 提交于 2019-11-27 03:53:17

问题


I have a java project and I want to develop it without replacing the source code from its place. I want to link my code to my workspace without replace physically?


回答1:


  1. Select the Project you want to reference from on Package Explorer
  2. Right-click and go to Properties ( or hit Ctrl-Enter ).
  3. Under Projects in Java Build Path you can add another project which is currently open.

If you want to override a class you can make a copy of it in your current project and move it further up in the classpath in Order and Export.




回答2:


Linking Source

Project properties -> Java build path (tree-item) -> Source (tab) -> Link source (button)

Linking Projects

Project properties -> Java build path (tree-item) -> Projects (tab) -> Add... (button)

Suggestion

See Eclipse help topic: Workbench User Guide > Tasks > Working with projects, folders and files > Creating linked resources.




回答3:


You can link to a project that exists outside your workspace. This allows the project to continue to exist outside but be referable for purposes of browsing source, debugging, breakpoints, etc. In Eclipse, from the menu:

  1. Select File | Import... and choose General > Existing Projects into Workspace
  2. On the next panel in the dialog, browse to the location of the project and ensure it's selected in the listbox.
  3. Be sure to not check the checkbox Copy projects into workspace. Click Finish.

Changes you make in the project in this workspace will be reflected into the project in it's native location.

Be sure that when you remove the project reference from the non-natively owned workspace, that you don't Delete project contents on disk (cannot be undone).



来源:https://stackoverflow.com/questions/6580360/how-to-link-project-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!