tags:

views:

26

answers:

3

I spent quite a bit of time modifying my Java code style settings to be the way I like.

For example, go to Windows -> Preferences -> Java -> Code Style -> Clean Up / Formatter / Code Templates.
I've set eclipse to use white space instead of tab chars, customized the heading on the top of java files, and a whole bunch of other stuff.

Now I'm working on a different computer and had to install a new copy of Eclipse Helios.
Is there a file or set of files I can reuse so I don't have to keep setting this up everytime?

+3  A: 

If you haven't set "project specific settings", it is in

workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.jdt.ui.prefs

If you have "project specific settings", it is in the ".settings" directory of your project.

<profile kind\="CleanUpProfile" name\="t1" version\="2">
  <setting id\="cleanup.remove_unused_private_fields" value\="true"/>
  <setting id\="cleanup.always_use_parentheses_in_expressions" value\="false"/>
  ...

That latter option (project specific settings) makes it easier for you to version it in your source control tool, as part of the other project files you would want to get back when doing a checkout of a new version of your project somewhere else.

See "Do you keep your project files under version control?" for more.

VonC
+1  A: 

Every single one of the options under Windows - > Preferences - > Java - > Code Style has the option to export the current setting to an XML file. You can then import that XML file into the other Eclipse install.

And store it in your SCM.

Instantsoup
A: 

Dont waste time trying to find the file in eclipse's settings area. Instead click the "edit" button on your settings profile and export it to a file of your choosing.

dwb
He doesn't have to, VonC did it already!
Instantsoup