If you are new to Eclipse IDE and wondering how to enable the line numbers for your code, you can do it in following steps,
- Go to the Gutter area of any file.
- Right Click → Show Line Numbers
- Now you should be able to see the line numbers.
Below are some screenshots that can help you guide to it.


Similarly if you want to disable line numbers Gutter → Right Click → Show line numbers
Alternate Option:You can do the same by using the menu options as well: Go to Windows → Preferences → General → Editors → Text Editors, now look for "Show line numbers" checkbox and tick it!
If you are using macOS you need to go to: Eclipse → Preferences → General → Editors → Text Editors → General → Editors → Text Editors
Note: ⛏️ This is no shortcut keys to do it!
Comments:
- Perfect! :) Worked.. Thanks
user2886 16 Jul 2020 14:07:03 GMT
- Further comments disabled!
- How to display hidden files in Eclipse (dot prefixed files)
- Convert existing code project into a git project using Eclipse
- How to enable line numbers in Eclipse IDE
- [Eclipse] Syntax error, annotations are only available if source level is 1.5 or greater
- Enable Spellcheck in eclipse workspace
- How to create a Git Project in Eclipse (Step-by-step)
- [Solution] Spring Tool Suite (STS) support for JSP (JAVA EE)
- How to Remove All Terminated Console tabs at once in Eclipse
- Eclipse Java: Multiple markers at this line error
- Compare Current and Previous Versions of Same File (Local History) in Eclipse
- Eclipse : Workspace was written with an older version of the product and will be updated
- How to Save Eclipse console logs in external log file
- Fix: Eclipse Cant Connect to any repository not Authorized Error GitHub
- How to remove unwanted Java imports in IntelliJ (alternative of eclipse Ctrl + Shift + O)
- How to Configure GitHub with Eclipse IDE in 2023
- How to use Content Assist in Eclipse IDE
- Enable Eclipse dark mode
- Fix: Eclipse Connection time out: github.com
- Java was started but returned exit code=13 [Eclipse]
- Java Decompiler Eclipse Plugin
- Add imports in eclipse shortcut key combinations
- Syntax error, parameterized types are only available if source level is 1.5 or greater [Java]
- [Eclipse] Enable or Disable print margin line
- Eclipse Error The JVM Shared Library JavaVirtualMachines does not contain the JNI_CreateJavaVM symbol
- How to reset Eclipse IDE Code Font
- Turn Off Auto-Brightness on iPhone running iOS 16 - iOS
- Error 50057 - User account is disabled. The account has been disabled by an administrator [Microsoft - Teams - Azure] - Microsoft
- Replace new line with comma in Sublime Text Editor - Sublime-Text
- [Solution] macOS could not be installed on your computer OSInstall.mpkg appears to be missing or damaged - MacOS
- Indent/Prettify HTML File in Notepad++ - NotepadPlusPlus
- How to Change Android Toast Position? - Android
- Android: programmatically turn Bluetooth on or off using Java code - Android
- Enable JSON Pretty Print in Java Jackson - Java