Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 275
powtac Avatar asked Feb 19 '10 10:02

powtac


People also ask

How do I go to a specific line number in Eclipse?

Thanks! Hal, Ctrl-L prompts you to go to a line number.

What is Ctrl G in Eclipse?

Search – Eclipse Shortcuts CTRL SHIFT G – Search for current cursor positioned word reference in workspace. CTRL H – Java search in workspace.

How do I move forward in Eclipse?

alt+left and alt+right — navigate through my source to back and forward. shortcuts for navigate > back and navigate > forward and backward . ctrl+m — maximizes the current view or editor. press ctrl+m again and it goes back to the previous size.


2 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.

like image 63
VonC Avatar answered Sep 28 '22 05:09

VonC


Finally fixed!!

On Windows:

eclipsec.exe -name Eclipse --launcher.openFile %USERPROFILE%\workspace\MyClass.java:50

On Linux/Mac:

eclipse -name Eclipse --launcher.openFile ~/workspace/MyClass.java:50
like image 33
krispy Avatar answered Sep 28 '22 04:09

krispy