在Eclipse中重命名项目还会重命名文件系统上的项目文件夹? [英] Should renaming a project in Eclipse also rename project folder on file system?

查看:446
本文介绍了在Eclipse中重命名项目还会重命名文件系统上的项目文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

重命名Eclipse中的项目还要重命名文件系统上的项目文件夹?



即使我在Eclipse上重命名文件,我的项目文件系统名称仍然保持不变。 / p>

我应该在Eclipse上将文件系统上的项目重命名为相同吗?

解决方案

如果项目使用使用默认位置复选框选中(表示项目在工作区目录中创建)复选框,则重命名项目似乎只会重命名底层文件系统目录。如果您创建项目并在工作区外部指定自定义位置,则在Eclipse 中重命名该项目不会重命名项目的主机目录。在这种情况下,您可能希望:


  1. 在Eclipse中重命名项目(将更新任何内部引用和.project文件)

  2. 从Eclipse Workbench视图中删除项目(确保删除确认对话框中选择删除文件内容选项 / />>
  3. 重命名文件系统中的项目目录。

  4. 将项目导入Eclipse工作区。

我很惊讶地学习到这一点(我用Eclipse 3.7进行了测试),但对我而言似乎是合乎逻辑的。这个想法是,工作区文件夹中的项目被认为是在Eclipse控制下,而不是位于文件系统任意位置的项目。


Should renaming a project in Eclipse also rename project folder on file system ?

My project file system name remains the same even when I rename the file on Eclipse.

Should I manually rename the project on the file system to same on Eclipse ?

解决方案

It appears that renaming a project will only rename the underlying filesystem directory if the project was created with the "Use Default Location" checkbox selected (meaning the project is created in the workspace directory). If you create a project and specify a custom location outside the workspace, renaming that project in Eclipse does not rename the project's host directory. In that case, you'll probably want to:

  1. Rename the project in Eclipse (which will update any internal references and the .project file)
  2. Remove the project from your Eclipse Workbench view (making sure that the "Delete file contents" option is NOT selected in the delete confirmation dialog).
  3. Rename the project's directory in your filesystem.
  4. Import the project back into your Eclipse workspace.

I was surprised to learn this (I tested it with Eclipse 3.7), but it seems to be logical to me. The idea is that projects in the workspace folder are considered to be "under Eclipse control" as opposed to projects that are located in arbitrary places on your filesystem.

这篇关于在Eclipse中重命名项目还会重命名文件系统上的项目文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆