How do I share my code formatting settings with another user?
Author: Deron Eriksson
Description: This tutorial shows how to export and import a profile to format Java code in Eclipse.
Tutorial created using: Windows Vista || JDK 1.6.0_04 || Eclipse Web Tools Platform 2.0.1 (Eclipse 3.3.1)


Page:    1 2 >

In another tutorial, we saw how we can create a formatting "profile" to represent a set of formatting options. We created a profile called "myprofile" that was essentially the EclipseSW built-in profile, except that line wrapping had been changed from 80 characters to 120 characters. It's possible to share a profile with other developers by exporting the profile, which other developers can then import. This is very useful since it allows all the developers on a team to share a common formatting profile.

We can go to the formatting options at Window → Preferences and JavaSW → Code Style → Formatter. The "myprofile" profile is selected, and I clicked the Edit button.

Edit 'myprofile'

This brings up the profile editor for "myprofile". I clicked the Export button and saved my profile as "myprofile.xml".

Click Export button

(Continued on page 2)

Page:    1 2 >