Right-Click in the console pane and at the bottom select preferences.

On the left side expand General >> select Editors >> Text Editors. You will see “Show line numbers”, check it and hit apply.

eclipse_editor_preferences