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

mkyong

Founder of Mkyong.com, passionate Java and open-source technologies. If you enjoy my tutorials, consider making a donation to these charities.

37 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
wew
12 years ago

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

mmxz
12 years ago

TY!!

Araya Patel
12 years ago

thanks

Rantho
7 years ago
Reply to  Araya Patel

Ok

Vishwavardhan Damaraju
12 years ago

thanks, it was clear and simple

Matej
12 years ago

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

siva
12 years ago

thanks

Daniel Coats
12 years ago

thank you thank you thank you

shafiq
12 years ago

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

MHr
12 years ago

thanks 🙂

Pankaj
12 years ago

Thank U very much, I perfectly got it.

Pen
12 years ago

thanks

Blake B
12 years ago

Thumbs Up. They bury it deep.

AP
12 years ago

thanks….for saving time

JM
12 years ago

Thanks! easy to understand.

Bo Zhang
12 years ago

thanks your help

Victor
12 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
12 years ago

Its working for me

Danilo
12 years ago

thanks

madirajukrishnachaitanya
12 years ago

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

Sabir
12 years ago

Thanks it solves my problem easily!!!

etherock
12 years ago

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

rjay
12 years ago

thanks men

Neil
12 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
13 years ago

Thanks. Really help

Freddy
13 years ago

Thank you!! 🙂

daryl fong
13 years ago

Perfect! Thanks.

Krishnamurthy
13 years ago

This website is Excellent. Thanks a lot…!

Krishnamurthy
13 years ago
Reply to  Krishnamurthy

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

Gabriele
13 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
13 years ago

you are awesome 🙂

Zia
13 years ago

Thanks for the lot of helpful postings