Eclipse – Display line number in the source code.

Line number in the source code is not enabled by default in Eclipse.

Source code view without line numbers.

eclipse-source-code-without-line-number

How to enable line number is the scource code?

Go to Windows => Preference => General => Editors => Text Editors and enable (check) Show line numbers check box.
eclipse-display-line-number-source-code

Source code with line numbers.

eclipse-source-code-with-line-number