Getting Eclipse to Draw a Line at Column 80
Thanks to Shane Miller for finding this solution.
There is a bug in Eclipse which has prevented us from accomplishing this in the past,
but Shane has found a workaround! See instructions, below.
- 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 it will probably be in the wrong place.
[This is a bug in Eclipse.] To get the line drawn in the right place, do 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.