1

Can Eclipse work without the .project and .classpath files in the project's root directory?

I was using Eclipse on Windows with a project (let's call it P) outside of my workspace. AFAIK in the root of each project there are always the files .project and .classpath. After switching to Linux I've found out that the files for P are missing - I see them nowhere, especially not in the folder P. This is not a problem (I could create them quickly), but how is it possible? I'm completely sure there were never there (otherwise there would have been tracked by my VCS just like now they do).

maaartinus
  • 44,714
  • 32
  • 161
  • 320
  • Possible duplicate of [What's in an Eclipse .classpath/.project file?](https://stackoverflow.com/questions/7186676/whats-in-an-eclipse-classpath-project-file) – Andrea Bergonzo Aug 07 '17 at 17:24
  • @AndreaBergonzo This question is far too old and I'm unable to even recall there was such a problem (or rather a mystery). It's definitely not a duplicate of the linked question, but I'm myself voting for closing "as no longer reproducible". Anyway, a 5+ years old eclipse is not relevant anymore. – maaartinus Aug 07 '17 at 18:45

2 Answers2

1

By default, Linux treats files that start with a dot as hidden files. So .project and .classpath won't show up unless you provide options to ls or your gui directory viewer to see them. Unix has worked this way as far back as I know (almost 25 years now).

To see them, cd to the project directory in your workspace and enter the command: ls -a.

BillRobertson42
  • 12,602
  • 4
  • 40
  • 57
  • You're right with `ls -a`, but as I said, the files definitely weren't there. I'm sure for the following reasons: 1. I had to create them (add something to the CLASSPATH). 2. I looked at the directory using `ll` (my alias for `ls -al`). 3. If they had existed, they would have been tracked by git (as they're now). This also proves that they never existed. So they must have been elsewhere or whatever... – maaartinus Feb 19 '12 at 06:40
  • The situation isn't really clear. You had a project in eclipse on Windows, and it had the .classpath and .project files, and the project was tracked in git and those files were present. Later you switched to Linux, cloned the repository and the files aren't there? Or you created a new project on Linux and the files just don't exist? – BillRobertson42 Feb 19 '12 at 16:24
0

The .project file is required in all Eclipse projects. You might be able to link to the file outside the folder of the project - I have never tried.

The .classpath file is only found for Java projects (or project types that derived from the Java project, such as Groovy, Xtend, ...). Again, this file can likely be a linked resource.

Assuming you have never used linked resources in Eclipse projects - most people haven't, then I think you problem is that the files was never properly copied from your old Windows system to your new Linux system...

Tonny Madsen
  • 12,628
  • 4
  • 31
  • 70