126

I use Eclipse with "external" projects - i.e. projects created from existing source.

Poking around in the workspace files, I cannot find any reference to these projects. My question is: how does Eclipse keep track of these projects?

I'd like to be able to add such a project to the workspace automatically (by generating .project and .classpath files).

bluish
  • 26,356
  • 27
  • 122
  • 180
Kris Pruden
  • 3,280
  • 4
  • 25
  • 30

6 Answers6

157

Windows:

<workspace>\.metadata\.plugins\org.eclipse.core.resources\.projects\

Linux / osx:

<workspace>/.metadata/.plugins/org.eclipse.core.resources/.projects/

Your project can exist outside the workspace, but all Eclipse-specific metadata are stored in that org.eclipse.core.resources\.projects directory As noted in the comments by tk421storm, and in Jeegar Patel's answer:

In order for manual changes to take effect, make sure to do File -> Refresh afterwards.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    @RoboAlex I usually don't edit it directly, but add or remove projects from the Eclipse workspace. – VonC Sep 07 '13 at 20:34
  • 3
    The last path is `.projects` on my system (Mint 16); is it different on Windows? – wchargin Jan 14 '14 at 15:29
  • @WChargin not sure, maybe it has changed more than 5 years later. Which Eclipse version are you using on Mint? – VonC Jan 14 '14 at 16:27
  • from Jeegar's answer below, in order for manual changes to take effect, make sure to do File -> Refresh afterwards. – tk421storm Oct 07 '21 at 14:42
  • @tk421storm Good point, thank you. I have included your comment in the answer for more visibility. – VonC Oct 07 '21 at 14:57
13

In Mac OS X, it is under

<workspace>/.metadata/.plugins/org.eclipse.core.resources/.projects
bluish
  • 26,356
  • 27
  • 122
  • 180
Magne Land
  • 1,204
  • 1
  • 9
  • 7
9

In Eclipse 3.3:

It's installed under your Eclipse workspace. Something like:

.metadata\.plugins\org.eclipse.core.resources\.projects\

within your workspace folder.

Under that folder is one folder per project. There's a file in there called .location, but it's binary.

So it looks like you can't do what you want, without interacting w/ Eclipse programmatically.

Pacerier
  • 86,231
  • 106
  • 366
  • 634
Dave DiFranco
  • 1,695
  • 10
  • 9
  • +1 for the pointer to .location. In my case, the workspace folder had **not** changed, but the (different) location where the projects lived: different drive letter. I ended up fixing these files in place with (D:->F:) `sfk replace -pat -binary _5552492F2F66696C653A2F443A2F_5552492F2F66696C653A2F463A2F_ -dir .metadata\.plugins\org.eclipse.core.resources\.projects -file .location` – mgaert Oct 02 '14 at 12:10
3

If you are using Perforce (imported the project as a Perforce project), then .cproject and .project will be located under the root of the PERFORCE project, not on the workspace folder.

Hope this helps :)

Sebastian
  • 31
  • 1
1

In Linux after deleting

<workspace>\.metadata\.plugins\org.eclipse.core.resources\.projects\

Does not worked.

After that i have done File->Refresh

Then it cleared all old project listed from eclipse.

Jeegar Patel
  • 26,264
  • 51
  • 149
  • 222
0

You can also have several workspaces - so you can connect to one and have set "A" of projects - and then connect to a different set when ever you like.

silverbugg
  • 214
  • 2
  • 7