英文:
Copied project still uses wrong folder
问题
如何克隆一个工作空间?我已经尝试将其文件从一个文件夹复制到另一个文件夹,但在使用Eclipse时它仍然打开旧文件夹。为了更容易理解,我将旧文件夹称为文件夹1,新文件夹称为文件夹2。我将工作空间从文件夹1复制到文件夹2。在Eclipse中,我选择文件夹2,但所有文件仍然来自文件夹1。
如果我尝试复制它,创建一个新文件夹,打开项目并将其重构到新文件夹,它只会失败,并显示非常含糊的错误,说有文件移动问题,但没有告诉我问题所在。解决方案是复制工作空间文件夹,并使用“一般”>“现有项目”导入工程到工作空间,但这也失败了。我尝试对一个空文件夹做同样的操作,但这只是将旧文件夹链接到新文件夹,而不是克隆它们。
尝试查看Eclipse的.metadata文件夹,但没有成功,即使在更改了旧目录的文件之后,我发现它仍然不可思议地不打开新文件夹!我将指向/folder1的部分重命名为指向/folder2,但不知何故,当我选择文件夹2时它仍然对所有内容打开文件夹1。我已经花了将近两个小时陷入困境,毫无结果地深入研究,现在我求助于这个社区,希望能得到一些帮助。
是的,我已经谷歌过,但实际上很少有结果对我有帮助,只有一个符合我情况的方法没有奏效。我需要克隆它,从头开始简单不是一个选项。
英文:
How do I clone a workspace? I've tried copying its files from one folder to another but when using this Eclipse just opens the old folders. For easier understanding, I'll refer to the old folders as folder1 and the new one as folder2. I copy my workspace from folder1 to folder2. Using Eclipse, I select folder2 but all of the files are still grabbed from folder1.
If I try copying it, making a new folder and opening the project and refactoring it to the new folder, it just fails with the very undescriptive error that there was a problem moving the files. Without actually telling me what the problem is. The solution was to copy the workspace folder, and import the project using general>existing projects into workspace, but this failed too. I tried doing the same to an empty folder but this just linked the old folder to the new one instead of cloning them.
Tried looking in the Eclipse .metadata folder with no luck, even after changing the files I found that had the old directory it bizarrely doesn't open the new folders! I renamed the parts that point to /folder1 to point to /folder2, but somehow it still opens folder1 for everything when I select folder2. I've wasted nearly two hours stumped, digging into it with no dice and I'm turning to this community hoping to get some help.
Yes, I've Googled it, very few results actually helped, with the only one fitting my situation not working. I NEED to clone this, starting from scratch is simply not an option.
答案1
得分: 0
克隆工作区的步骤:
- 通过文件 > 切换工作区 > 其他... 创建一个新的工作区(此对话框还提供复制您的设置的选项)
- 在新的工作区中,通过文件 > 导入...: 通用 > 将现有项目导入工作区 导入项目,并确保选中复选框将项目复制到工作区
如果项目位于不同位置或用于传输,您还可以首先执行文件 > 导出...: 通用 > 归档文件,然后从该归档文件中导入项目。
请注意,不应编辑、移动或删除.metadata
文件夹。
英文:
To clone a workspace:
- Create a new workspace via File > Switch Workspace > Other... (this dialog offers also the option to copy your settings)
- In the new workspace import the projects via File > Import...: General > Import Existing Projects into Workspace and make sure the checkbox Copy projects into workspace is checked
When the projects are located at different places or for transfer, you can also do File > Export...: General > Archive File first and then import the projects from that archive file.
Please note, the .metadata
folder is not intended to be edited, moved or deleted.
专注分享java语言的经验与见解,让所有开发者获益!
评论