Question

Why does eclipse create a .settings directory?

i have noticed that eclipse recently creates a .settings directory with 1 file inside and i am wondering if i should add this to version control? SVN?

also, is this new? i have been using eclipse for quite a while, but never noticed it.

the contents of the file in the directory is this:

#Sun Oct 11 14:57:03 CEST 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

shouldnt these settings be workspace-wide and not project specific?

 45  34286  45
1 Jan 1970

Solution

 29

This file records project specific settings vs. workspace preferences.

I noticed that this file is usually created when you convert a regular Java project to Java EE project.

The only time I would check this file in is when the project's compiler/warning settings are different from the default workspace settings.

This may be the case when some legacy projects cannot be compiled with the latest and greatest java compiler, or when the source code generated by a 3rd party produces a lot of warnings that are benign but pollute your Problems view.

If you are going to use project specific settings, then definitely check this file in. Otherwise delete it.

2009-10-11

Solution

 20

The .settings folder is used by various plugins to set persistent 'Properties' as opposed to 'Preferences' to specify project specific settings that should be preserved.

This is usually a directory you most definitely want checked into svn/cvs/git etc as it will ensure that all users who check that project out into eclipse use the right project specific settings.

In our case we use it to supply a minimum compiler version of 5 since some devs are on Java 5 versus 6 etc but we want things compiled to 5 for our servers. We also use it to enforce some coding standards and auto-formaters which makes version diffs much easier to read.

In your specific case you selected 'Enable Project Specific Settings' under "Properties->Java Compiler" by right clicking on the project and choosing properties.

2011-01-03