tags:

views:

207

answers:

3

How does Eclipse handle excluding Java files in the project??

In C# the list of files in the project is handled in the sln file - There seems nothing similar in Eclipse!!

Any ideas?

+3  A: 

In Visual Studio files for C# projects are stored in the .csproj files. Solutions are just containers for projects (which can be C#/C++/VB/... projects).

The last time I worked with Eclipse all files beneath the project's root were automatically included. When one was excluded from the build the project's .classpath file was modified:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
  <classpathentry excluding="ExcludedFile.java" kind="src" path="src"/>
  <!-- ... other entries ... -->
</classpath>

You can exclude a file in Eclipse by right-clicking it in the Package Explorer and then choosing Build Path -> Exclude.

gix
+1  A: 

Project specific meta information (like this) is stored in either the .project or the. .classpath files in the root of the project. These are hidden in the project view, but visible in the navigator view.

Thorbjørn Ravn Andersen
A: 

You shouldn't need to directly edit the .project and .classpath files mentioned in the other answers. As with Visual Studio, the IDE generates and owns these project meta data files for you.

For example, you can exclude an individual java file from the build path by right clicking on it in the project explorer and selecting "Build path / Exclude". That will make the required .classpath changes for you.

serg10
We are software developers. We write the programs that parse and modify configuration files. We write those programs in vim. We should be OK with modifying them by hand rather than depending on an IDE. Especially when IDEs cannot handle all the things you would like to tell them to do.
Justice