Jack Kada
Jack Kada

Reputation: 25262

C# SLN file approach in Eclipse (Java)

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?

Upvotes: 2

Views: 1366

Answers (3)

serg10
serg10

Reputation: 32717

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.

Upvotes: -1

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.

Upvotes: 1

gix
gix

Reputation: 5796

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.

Upvotes: 3

Related Questions