Main Tutorials

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 Author

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

Comments

Subscribe
Notify of
37 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
wew
9 years ago

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

mmxz
9 years ago

TY!!

Araya Patel
9 years ago

thanks

Rantho
4 years ago
Reply to  Araya Patel

Ok

Vishwavardhan Damaraju
9 years ago

thanks, it was clear and simple

Matej
9 years ago

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

siva
9 years ago

thanks

Daniel Coats
10 years ago

thank you thank you thank you

shafiq
10 years ago

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

MHr
10 years ago

thanks 🙂

Pankaj
10 years ago

Thank U very much, I perfectly got it.

Pen
10 years ago

thanks

Blake B
10 years ago

Thumbs Up. They bury it deep.

AP
10 years ago

thanks….for saving time

JM
10 years ago

Thanks! easy to understand.

Bo Zhang
10 years ago

thanks your help

Victor
10 years ago

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
10 years ago

Its working for me

Danilo
10 years ago

thanks

madirajukrishnachaitanya
10 years ago

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

Sabir
10 years ago

Thanks it solves my problem easily!!!

etherock
10 years ago

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

rjay
10 years ago

thanks men

Neil
10 years ago

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
10 years ago

Thanks. Really help

Freddy
10 years ago

Thank you!! 🙂

daryl fong
10 years ago

Perfect! Thanks.

Krishnamurthy
10 years ago

This website is Excellent. Thanks a lot…!

Krishnamurthy
10 years ago
Reply to  Krishnamurthy

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

Gabriele
10 years ago

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
10 years ago

you are awesome 🙂

Zia
11 years ago

Thanks for the lot of helpful postings