Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Eclipse's project location in file-system

Tags:

java

eclipse

I have a project of eclipse that is located in some folder on my my local-disk. Let's say: c:\proj1.0 and after a while I need to change the folder name to proj2.0 (why? because I started working on the next version of my application and I want to save the time of creating the new project in Eclipse. The older version is stored in the source control anyway)

How can I do it? if I try to change it than the project cannot be found by eclipse. I didn't find the eclipse configuration file where the absolute location of the project is defined.

like image 638
Spiderman Avatar asked Apr 11 '11 13:04

Spiderman


2 Answers

You have to change the project's name from Eclipse. In the Package explorer Right-click the project -> Refactor -> Rename. Or simply click on the project and press Alt + Shift + R. This way no configuration will be lost.

Another way would be to move the project's folder by Right-clicking on the project > Refactor > Move.

Alternatively, if you already renamed the folder's name and cannot see the project in Eclipse anymore, you can select File menu -> Import -> Existing projects into Workspace, navigate to the parent folder of your project's folder, then select the projects you want to import and press Finish.

like image 151
janhink Avatar answered Oct 06 '22 01:10

janhink


It sounds like you think the name of the project comes from the workspace folder. This is not the case. The project name is contained in a hidden .project file. The refactoring tools are probably a better way to go, but that doesn't seem to be what you want.

  1. Make new proj2.0 directory.
  2. Copy hidden .project and .classpath files from proj1.0 directory to proj2.0 directory.
  3. Edit .project in a plain text editor and change the name.
  4. In Eclipse, Import Existing Projects into workspace and point to the proj2.0 directory.
like image 34
wolfcastle Avatar answered Oct 06 '22 01:10

wolfcastle