将 Eclipse 工作区从 ~ 移动到新目录?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15165135/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 21:34:42  来源:igfitidea点击:

Moving Eclipse Workspace from ~ to new directory?

eclipse

提问by Amil

Okay, so I made a mistake of setting my home directory (~, a.k.a. /home/user) to be my workspace location on my RHEL6 box.

好的,所以我错误地将我的主目录(~,又名 /home/user)设置为我在 RHEL6 机器上的工作区位置。

I want to change my workspace to ~/workspace. However, I can't seem to do this by copying files. For some background, the project I am currently working on and have fully set up under the ~ workspace, has all source files stored elsewhere (~/depot/.../../../../src), so I don't even see a folder in ~ representing my project.

我想将我的工作区更改为 ~/workspace。但是,我似乎无法通过复制文件来做到这一点。对于某些背景,我目前正在处理的项目已在 ~ 工作区下完全设置,所有源文件都存储在其他地方 (~/depot/.../../../../src),所以我甚至看不到 ~ 中代表我的项目的文件夹。

回答by niculare

Do the following steps:

执行以下步骤:

  • close all the projects in workspace
  • close Eclipse
  • move the directory .metadatafrom ~to ~/workspace
  • open Eclipse and when prompted for the workspace selection set it to ~/workspace
  • 关闭工作区中的所有项目
  • 关闭日食
  • 将目录.metadata从移动~~/workspace
  • 打开 Eclipse 并在提示选择工作区时将其设置为 ~/workspace

回答by Svetoslav Marinov

On Windows 8 I did this:

在 Windows 8 上,我这样做了:

  1. Closed All of the projects in Eclipse
  2. Closed Eclipse
  3. Physically moved the workspace folder to a new location (in my case I put it into c:\projects as I have this backed up).
  4. Started Eclipse
  5. File > Switch Workspace and selected the new path. Then eclipse restarted itself and all projects showed up.
  1. 关闭 Eclipse 中的所有项目
  2. 封闭的日食
  3. 将工作区文件夹物理移动到一个新位置(在我的情况下,我将它放入 c:\projects 中,因为我已经备份了它)。
  4. 启动 Eclipse
  5. 文件 > 切换工作区并选择新路径。然后 eclipse 重新启动,所有项目都出现了。

回答by Nendrel

After closing Eclipse projects and Eclipse itself, move all project folders and .metadatafolder in the new workspace folder.

关闭 Eclipse 项目和 Eclipse 本身后,将所有项目文件夹和.metadata文件夹移动到新的工作区文件夹中。

回答by Guru

  1. Close Eclipse.
  2. Open the location of the workspace and cut paste the entire directory (which contains the ".metadata" directory into the intended location.
  3. Restart Eclipse with newly copied folder as the workspace (parent directory of ".metadata" folder).
  1. 关闭日食。
  2. 打开工作区的位置并将整个目录(其中包含“.metadata”目录)剪切粘贴到预期位置。
  3. 使用新复制的文件夹作为工作区(“.metadata”文件夹的父目录)重新启动 Eclipse。

回答by Beginner

I was testing to move files manually from workspace and suddenly my eclipse did not show them in my eclipse view so i moved them back to the same location where they have come from, entered eclipse and clicked right click on the package where i am expecting those files and clicked Refresh, Now i can view them on my Eclipse under packages, so try do refreshing it might work for u.

我正在测试从工作区手动移动文件,突然我的 eclipse 没有在我的 eclipse 视图中显示它们,所以我将它们移回它们来自的相同位置,输入 eclipse 并单击右键单击我期望的包文件并单击刷新,现在我可以在我的 Eclipse 上的包下查看它们,所以尝试刷新它可能对你有用。