How to display line numbers in Eclipse

By default, Eclipse’s editor will not display line numbers, it’s no good for debugging. Here’s a tip to show you how to turn on the “display line numbers” feature in Eclipse.

In Eclipse IDE, select “Windows” > “Preference” > “General” > “Editors” > “Text Editors” , check on the “Show line numbers” option.

line numbers in Eclipse

See result.

line number in eclipse editor

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.

Comments

Leave a Reply

avatar
newest oldest most voted
wew
Guest
wew

why IDEs dont do this by default I’ll never know . _.

mmxz
Guest
mmxz

TY!!

Araya Patel
Guest
Araya Patel

thanks

Vishwavardhan Damaraju
Guest
Vishwavardhan Damaraju

thanks, it was clear and simple

Matej
Guest
Matej

Thank you, it would be hard to find it without your help.

siva
Guest
siva

thanks

Daniel Coats
Guest
Daniel Coats

thank you thank you thank you

shafiq
Guest
shafiq

thanks mate.!!! thanks a ton.!!!

MHr
Guest
MHr

thanks :)

Pankaj
Guest
Pankaj

Thank U very much, I perfectly got it.

Pen
Guest
Pen

thanks

Blake B
Guest
Blake B

Thumbs Up. They bury it deep.

AP
Guest
AP

thanks….for saving time

JM
Guest
JM

Thanks! easy to understand.

Bo Zhang
Guest
Bo Zhang

thanks your help

Victor
Guest
Victor

I want to thank you for the clear and easy steps. It took me about a minute or so following your directions.
THANKS for your service!!!!

suresh R
Guest
suresh R

Its working for me

Danilo
Guest
Danilo

thanks

madirajukrishnachaitanya
Guest
madirajukrishnachaitanya

Hi Sir,
Your post solved my problem.Thank You.
~Chaitanya

Sabir
Guest
Sabir

Thanks it solves my problem easily!!!

etherock
Guest
etherock

You, sir, have helped me in my journeys to code a minecraft client. ;) love you man

rjay
Guest
rjay

thanks men

Neil
Guest
Neil

Very helpful – I’m surprised that eclipse doesn’t display line-numbers by default, essential for de-bug especially as line-numbers are reported in LogCat. Thanks again, Neil

edo
Guest
edo

Thanks. Really help

Freddy
Guest
Freddy

Thank you!! :)

daryl fong
Guest
daryl fong

Perfect! Thanks.

Krishnamurthy
Guest
Krishnamurthy

This website is Excellent. Thanks a lot…!

Krishnamurthy
Guest
Krishnamurthy

Is there any other websites for C++ similar to this?

Gabriele
Guest
Gabriele

In Mac OS , you have to go Eclipse > Preferences > General > Editors > Text Editors or use short command “CMD+,” and than follow General > Editors > Text Editors

Muhammed Rfaat
Guest
Muhammed Rfaat

you are awesome :)

Zia
Guest
Zia

Thanks for the lot of helpful postings