简体   繁体   English

从 eclipse 工作区移动项目

[英]Moving projects from eclipse workspace

I am using eclipse and I moved some projects(Projects with the name Mc Bot) in my workspace to another folder.我正在使用 eclipse 并将我的工作区中的一些项目(名为 Mc Bot 的项目)移动到另一个文件夹。 However, when I open eclipse with my workspace, projects still appear like this in package explorer.但是,当我用我的工作区打开 eclipse 时,package 资源管理器中的项目仍然像这样出现。

在此处输入图像描述

How can I fix that?我该如何解决?

I would just delete it here in eclipse (don't mark the checkbox to delete on disk) and then reimport it.我将在 eclipse 中将其删除(不要在磁盘上标记要删除的复选框),然后重新导入。 So in this view from the screenshot just open the context-menu, say import and chose your projects again.因此,在屏幕截图的这个视图中,只需打开上下文菜单,说导入并再次选择您的项目。

You cannot move project folders on your hard drive and expect Eclipse to update automatically.您无法移动硬盘上的项目文件夹并期望 Eclipse 自动更新。 The folders contain metafiles that Eclipse needs to properly load the workspace on startup.这些文件夹包含 Eclipse 在启动时正确加载工作区所需的元文件。

  1. It is better to either rename/move the projects within Eclipse .最好在 Eclipse重命名/移动项目。

  2. Or to remove and then re-add them to Eclipse's project management.或者将它们删除然后重新添加到 Eclipse 的项目管理中。

However, make sure to not accidentally delete the files from disk, when removing the old project from Eclipse.但是,当从 Eclipse 中删除旧项目时,请确保不要意外删除磁盘中的文件。 There is a checkbox within the confirmation dialog that - in this case - you should not check.确认对话框中有一个复选框 - 在这种情况下 - 您不应该选中。

Especially when you are working with a code versioning system (such as Git or SVN), it is important to rename your files and folders within the code editor.尤其是在使用代码版本控制系统(例如 Git 或 SVN)时,在代码编辑器中重命名文件和文件夹非常重要。 Otherwise your repository might get out of sync.否则,您的存储库可能会不同步。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM