Although it is seems simple but I’ve seen people struggle with this. Therefore, I decided to put a real quick post on how to show line numbers in Eclipse editor. There are two ways to enable line numbers in Eclipse.

First method
Open Eclipse and in the menu bar, go to Window -> Preferences and in the pop-up window, go to
General -> Editors -> Text Editors. Click on the option, Show line numbers and click on the Apply and Close button.

Second method
This is an easy way to enable line numbers. Actually it is shortcut way to do the above steps. Open any Java source file in any project and right click on the left bar in the code window. In the pop-up window which opens up, click on the option, Show Line Numbers.

How to show line numbers in Eclipse
    

6 thoughts on “How to show line numbers in Eclipse

  • November 18, 2019 at 9:34 AM
    Permalink

    That’s great news! You’re welcome.

  • November 18, 2019 at 7:12 AM
    Permalink

    Gotcha! It wasn’t a workspace problem, but a preference to don’t save configs:
    Eclipse > Preferences > Oomph > Setup Tasks > Preference Recorder and turn it off.
    Thank you so much!

  • November 17, 2019 at 5:02 AM
    Permalink

    Yes, I did.

  • November 16, 2019 at 11:21 AM
    Permalink

    I’m not sure what could cause the line number to disappear each time Eclipse is launched. Did you save the changes by clicking on ‘Apply and Close’?

  • November 13, 2019 at 4:14 AM
    Permalink

    Every time that I lunch Eclipse the line numbers are disabled. How can I fix it?

Comments, Questions or Suggestions: