David Wolever
David Wolever

Reputation: 154494

Eclipse: Get location of the current file?

If I've got a file open in Eclipse, how can I figure out where it is on the filesystem?

For example, in Vim I would use :pwd.

Upvotes: 37

Views: 46148

Answers (6)

Topher Fangio
Topher Fangio

Reputation: 20667

Eclipse also has the ability to link the explorer view with the current file, so that whenever you change a file, it is expanded and selected in the explorer view.

Just look for the following image at the top of the view: alt text

Upvotes: 3

CT Liv
CT Liv

Reputation: 329

The other solution ("File-->Properties" or "Alt+Enter") didn't work for me.

I use:

  • Right Click (in current editor) --> Show In (shortcut: Alt+Shift+W) --> Project Explorer

This shows in Project Explorer the location of the file. If the file is a class in a referenced library, the dependency tree is automatically opened.

Upvotes: 6

mr.maga
mr.maga

Reputation: 91

Linking to Project Explorer won't work if you have many files - it will select the right file in the list, but it won't "scroll" to that portion so it is visible.

You'd have to manual scroll the Project Explorer view to see where the file is. It could also be nested so deeply that the full location will be obscured by truncation.

Another way to quickly (keyboard-free) see the path is to hover over the file type icon (on top of the open editor window).

Upvotes: 2

Grundlefleck
Grundlefleck

Reputation: 129257

What you're looking for is the 'Properties' dialogue for the current file. This can be activated in two ways:

  • Selecting from the menu: File -> Properties
  • Using the shortcut: Alt + Enter

This gives you a dialogue which contains both the full path of the document, as well as the relative path from the workspace root.

The dialogue can be quite handy: it allows you to highlight and copy the file path.

Upvotes: 3

Alexandre Pauzies
Alexandre Pauzies

Reputation: 801

Use the Eclipse menu:

File->Properties

or the shortcut:

Alt-Enter

You should be able to see the Location associated with the Resource

Upvotes: 53

tangens
tangens

Reputation: 39733

Just hit Alt-Enter.

Upvotes: 12

Related Questions