Archive

Archive for March, 2012

Java line wrapping in Eclipse editor

Open preferences and search for “Format” or select Java->Code Style->Formatter from the left menu. The default profile is called “Eclipse [built-in]” and if you want to make changes to the Java Formatter you will need to copy it and create your own profile. This can be done with the “New” button right below the profile name.

Once you have created your own Java Formatter, make sure it’s selected and hit the edit button. Select the “Line Wrapping” tab. Under general settings you will see “Maximum line width:”. Set this to a numerical value  such as 180 characters. Save and apply that and return to your code.

Categories: Eclipse, Misc