How can I show line numbers by default in Eclipse?
Go to Windows → Preferences → General → Text Editors → Show numberlines. Click OK, then Apply changes. Then it will show the line count automatically.
this will be the appropriate solution for asked question:
String lineNumbers = AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER; EditorsUI.getPreferenceStore().setValue(lineNumbers, true);
Open Eclipse
goto -> Windows -> Preferences -> Editor -> Text Editors -> Show Line No
Tick the Show Line No checkbox
Eclipse has a search feature in the top left box of the Preferences. Type in 'line numbers' in that search box, and presto...
In case you're tired of googling each time you forget...