Getting Eclipse to Draw a Line at Column 80
- Drawing a vertical line on the screen.
- Make sure you are in Java perspective.
- From the menu, select "Window", "Preferences", "General", "Editors", "Text Editors".
- Select the checkbox that says "Show print margin".
- Type the number 80 into the box that says "Print margin column.".
- The steps above will draw a vertical line on the screen, but you need to verify that it is in
the correct position. In the past there was a bug in Eclipse that would position the line
in the wrong place. If this happens in your case, try the following:
- From the menu, select "Window", "Preferences", "Java", "Code Style", "Formatter".
- Click the button that says "New". (You need to create a new "profile".)
- Type in any name you want, perhaps "CMSC", and click "OK".
- Click the tab that says "Line Wrapping".
- In the box labeled "Maximum line width" enter the value 80.
- Click "OK".
- Click "OK" again.