How to open a file in Eclipse AND jump to a specific line?

Viewed 15802

I can open a file in exclipse, but is there any syntax to jump to a specific line?

VI can do this by

vi -c LINE filename
7 Answers

Not exactly the right answer, but for Java file, you can use the package explorer, or the outline view, useful to select a group of lines) and open the file to the line matching a Java element (class, method, variable, ...)

Eclipse open

Once the file is already opened, CTRL+L is the way to go to a line of the currently edited file, as Adi mentions in the comment.

  1. CTRL+SHIFT+R (Open Resource) or CTRL+SHIFT+T (Open Type, for classes only)

  2. Type the name / the start of the name / the first letters of a camel case name

  3. CTRL+L (Go to line)

Try

eclipse.exe file.txt:22 

for newer versions of eclipse, and

eclipse.exe file.txt+178

for older ones.

Continuing from @raho's response, the complete menu path is: Window -> Preferences -> General -> Keys

This won't work on c++ as far as I can tell.

(I'm using Oxygen 4.7.1a)

Related