Introduction
A file named .project marks a folder as a project in the
Eclipse IDE. It holds the project’s name, the
builders that run when it is built and its natures, which say what kind of project it
is, such as a Java or a C/C++ project, and so which tools Eclipse switches on for it.
The file has no name before the dot, so it is hidden on macOS and Linux.
Other settings sit beside it. A Java project has a .classpath file
listing its source folders, output folder and libraries, and plugins keep their
preferences in a .settings folder.
Structure
The file is XML with a projectDescription root. It contains the
name, an optional comment, a projects list of
referenced projects, a buildSpec of buildCommand entries each
naming a builder, and a natures list. It can also define linked resources:
folders or files kept outside the project folder, resource filters and path
variables. Every element is on the .project
elements page, and the Java build path file on the
.classpath page.
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Not described
Known, not yet covered
- Reference: the order of elements in
.projectand the meaning of some.classpathentry kinds, in Eclipse’s source and help; see project file and classpath. - Viewer: there is no viewer for Eclipse projects yet.
Links
Software
- Eclipse IDE – the IDE that makes and reads these files (Windows, macOS, Linux)
- Visual Studio Code – code editor whose Java extension reads and writes these files (Windows, macOS, Linux)