Line Numbers in Eclipse

It’s 4am in the morning. You’ve been coding in Java for the past 6 hours and realise something’s missing from your Eclipse editor .. something that can confirm that the last 6 hours weren’t a WASTE of time..

and that is line numbers.

To turn on line numbering in Eclipse, simply do the following;

1) Windows -> Preferences
2) General – > Editors -> Text Editors

and click the “Show Line Numbers” checkbox.

Now was the last 6 hours a waste?

57 Responses to “Line Numbers in Eclipse”

  1. Alan Peters says:

    Thank you! my goodness Eclipse can be maddening.

  2. Oliver says:

    My generation is soft, I ‘googled’ it before I even went searching. Thanks.

  3. Steve S says:

    Eclipse F1 was no help but your blog was. Thanks!

  4. Eclipsed says:

    Absolutely miserable UI! Thanks so much for posting this simple tip.

  5. C1 says:


  6. Rapi says:

    Thank you so much! Haha. So simple yet magnanimous in nature. :D

  7. Harvey Ramer says:

    Great little tip. Thanks!

  8. Ankur Chandra says:

    Thanks dude.. Great tip..
    I use net beans and always thot why the h e l l dus this is dus not have line numbers!!

  9. ravi says:


    Thanks so much for assisting showing line numbers.

  10. Jan says:

    HeY! Thanks dude for the info .

  11. imi says:

    Thank You for giving this tip…it helps a lot while coding

  12. shya says:

    thks mone..

  13. eclips novice says:

    Thanks, also googled before I started searching, thanks, saved me a lot of time

  14. kevin says:

    thanks mate

  15. Lakshman kumar says:

    Thanks giving the answer for eclipse line numbers

  16. Eric says:

    No. The last 8 hours were not a waste. 470 lines of client and server code =)

  17. Vivek says:

    :D ..I was in the same scenario!! Cheers!

  18. sunil says:

    thank you

  19. raghav says:

    Thanks alot.
    God Bless u..

  20. bo says:

    damn im dizzy about it, thanks man

  21. Cris says:

    Thanks man. Your a great help.

  22. Mahendra says:

    Hey, thank you for the simple yet useful tip..

  23. farrafar says:

    thanks for this little tip. You posted it more than 2 years ago, and it’s still quite useful for some of us

  24. anil kumar khichar says:

    thnks to all. i m switching from visual studio to eclipse so i really needs line numbers as per my habit……thanks again.

  25. Nila says:

    Cheers Jamsi, saved lots of time :)

  26. Big Eclipse says:

    Great tip. Thanks.

  27. Outsopken says:


    Actually went to that dialog, but never noticed the check box.

    Talk about not seeing the obvious!

  28. Paul Moffett says:

    thanks! I also googled it before trying to work it out! awesome!

  29. BryBry says:

    SO CLOSE.. I did windows>>preferences>>general>>editors>>text editors and then couldn’t find it..only to realize that i only clicked the collapsible arrows and not the words “text editors”


  30. delta says:

    Thanks a lot!!!!

  31. CJ says:

    God bless you and thanks for that!:-)

  32. nim says:

    g8 help
    thank you so much:)

  33. rajat says:

    thank you

  34. Vineet says:

    Thanks …. Dude..

  35. Ashish Wadatkar says:

    Thanks frnd For your help

  36. Nick says:

    Thanks! And yes I’ve been looking at java for 6 hours…

  37. OR – you may just right click on the left vertical editor window bar and turn them on and off!

  38. Devesh says:

    Thanks !!! Great tip !!!

  39. dana says:

    thank you.. small useful tips!!

  40. Jan says:

    Thank you! When you know, where to look, it couldn’t be easier.

  41. John says:

    Small tip yet so helpful…

  42. Rambabu Pudi says:

    Thanks dude.

  43. ishu says:

    thk u very much

  44. Wally says:

    Thanks, man

  45. rafi says:

    why can’t they keep it on by default, it makes no sense to have it off.

  46. riff says:

    Thanx a lot man !

  47. James says:

    Thanks it very was helpful

  48. roco says:

    Eclipse Helios doesn’t have General in Preferences

  49. player_03 says:

    roco: In that case, try Gerard’s suggestion: right-click the bar where the line numbers should be. The option will be in that menu as well.

  50. Alan says:

    Thank god, it really wasn’t a waste! Thanks for the tip.

  51. adam says:

    you can also right click on the left area where you would expect them and it is in that menu

  52. islam says:

    thanks man.

  53. Omnamah says:

    Adam wins. Simplicity always wins.
    Kudos to OP all the same.

  54. Awk34 says:

    God why do they have to hide line numbers so well? Thank you!

  55. Atul_shukla says:

    Thanx a lot……..Really G8 Tips!! for Eclipse Beginners.

Leave a Reply

You must be logged in to post a comment.