• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Renaming project outside of eclipse and importing it

 
Ranch Hand
Posts: 254
1
MySQL Database Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to work on a copy of an Eclipse project. For that, I renamed the project name outside Eclipse and then I tried to import it in Eclipse. But the wizard refuses to finish the operation.

I noticed that I have a .project file which contained the old name of the project. I am thinking to modifying the this file with the new project name. Is this the way to go?

This is a Java project and not a web application so I presume there is no thing to worry like context that plays a role in forming URL to a resource.
 
Ahsan Bagwan
Ranch Hand
Posts: 254
1
MySQL Database Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I edited the .project to reflect the new name, and now the wizard allows the operation to finish. So, that's it?
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably. The .project file is what defines the project to Eclipse.

Having said that, it would have been better to rename the project within Eclipse, just because we think that we knew what needed to be changes, but Eclipse knows.

A Project and the directory that it's in don't have to have the same name, incidentally.
 
Ahsan Bagwan
Ranch Hand
Posts: 254
1
MySQL Database Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your inputs Tim! I will remember to rename the project in the IDE itself (using the Refactor option in the project context menu I think).

Regarding the different name of directory and project, could you expound more on it. After searching on google, I came across some SO links that mention that projects in same workspace should have different name. Is my understanding correct?
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Every project in a workspace has to have a unique name. So I have "mywebapp_dev" and "mywebapp_production" for example.

However, the project directory can have any valid directory name, so "mywebapp_production" might actually point to a project directory something like "mywebapp_version_3272".

Some of my projects aren't even physically located in the workspace directory at all for various reasons. So their .project definitions reference the actual directory tree that they're located under.

Come to think of it, that's one reason why simply editing the ".project" file wouldn't always work. Since the workspace doesn't just scan the entire filesystem, I'm wagering that the master project list for the workspace is held somewhere within the workspace metadata directory.
 
reply
    Bookmark Topic Watch Topic
  • New Topic