46

In eclipse, is there a way, to reveal the currently selected file in the filesystem. I currently need it to open in explorer, but it could also be in finder or nautilus.

Basically, I do not need the "Open with System Editor" option. I would like a right-click menu with the option: "Show file in explorer/finder/nautilus".

Thanks

pbreault
  • 14,176
  • 18
  • 45
  • 38

11 Answers11

51

Note: You can also develop your own external tool to open the file in a Windows explorer

alt text

Or you can use an eclipse plugin like StartExplorer.

alt text


Notes on MacOS:

zvikico mentions:

On Mac OS X, replace the location with /usr/bin/open and the arguments should be just ${container_loc}.

But Adam cautions:

Doesn't work - OSX, you need to put quotes around the ${container_loc} otherwise you'll often get bizarre error messages because it can't cope with spaces in file names.

But user2036022 details:

you can use -R "${resource_loc}" on macosx as argument to /usr/bin/open to be consistent with other similar tools.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 6
    Great tip. On Mac OS X, replace the location with /usr/bin/open and the arguments should be just ${container_loc}. – zvikico Jul 22 '09 at 05:27
  • love your 'external tool' solution .. very tidy and no plugin! tip: and `/e,` before `/select` to open with folders panel – pstanton Jun 15 '11 at 00:51
  • omg ! 3 years spending time right click, properties, get path, and finder, while I could do it in one clic ! :'( – darksider Dec 17 '12 at 10:01
  • @zvikico Doesn't work - OSX, you need to put quotes around the ${container_loc} otherwise you'll often get bizarre error messages because it can't cope with spaces in file names. – Adam Feb 25 '13 at 10:55
15

ExploreFS is a cross platform plugin and works fine on Ubuntu and Mac OSX.

  1. open "Install New Software" (from help menu in OSX),
  2. add http://www.junginger.biz/eclipse/,
  3. select ExploreFS from the checklist,
  4. choose appropriate options and install the extension.

Now you can click on your project, package or file and select Explore in File System and it will open the location in your default file manager.

screenshot

Sufian
  • 6,405
  • 16
  • 66
  • 120
10

I've been recently using Eclipse Luna version, and it has that feature natively implemented, very nice!

In "Project Explorer" view, right click on the file you're interested in --> "Show In" --> "System Explorer"

enter image description here

Osmar
  • 557
  • 6
  • 10
  • I was happy to read this in the Luna "What's New" but I can't get it to show up in actual use. Is it file extension specific? I have no "Show In" menu's except in Team>. – 8None1 Nov 19 '14 at 15:14
  • @8None1 It's not file extension specific, it should appear once you right click on the file you are interested in, it's right below the "New" option. Also you can display it if you press Alt+Shift+W. Remember to select the file you want to view before using the keyboard shortcut – Osmar Nov 20 '14 at 15:46
  • Thanks for the clarification. I see the Show In but only on CVS managed projects. Any projects that are Git don't show it. If I look in the Git Perspective - Working Directory, I see the 'Show In' but it's unavailable (gray). – 8None1 Dec 18 '14 at 00:11
5

Open the Properties of the file (Right Click->Properties) and the dialog will give you the full filesystem path.

Adam Batkin
  • 51,711
  • 9
  • 123
  • 115
  • 5
    He didn't want to SEE the path, he wanted to OPEN the folder. Seeing the path is almost useless because you then have to waste ages navigating by hand until you reach it. – Adam Feb 25 '13 at 10:51
4

Have a look at the PluginBox: http://pluginbox.sourceforge.net/plugins.html. This works with Linux as well. You can configure it precisely or choose a schema for Gnome, KDE, ...

robsch
  • 9,358
  • 9
  • 63
  • 104
4

Try the EasyShell extension: http://marketplace.eclipse.org/content/easyshell

Mr. Lance E Sloan
  • 3,297
  • 5
  • 35
  • 50
2

Why don't you right click on your file and select "show in> system explorer" then you will find life is beautiful.

BTW, my eclipse version :Luna Service Release 1 (4.4.1)[for mac]

steven
  • 529
  • 6
  • 15
  • Oddly, the Show In menu is not an option in my Luna install (4.4.x). And in my install of Mars (4.5.0) the Show In menu only has the option "Terminal". (It opens an Eclipse Terminal view with the working directory set to the file's.) – Bampfer Jul 09 '15 at 15:47
1
  • @VonC has given the solution, but this solutions helps to understand more and put shortcut to the feature:

enter image description here

enter image description here

  • Explorer command line arguments

    • /select [object] - selects the file or folder in the new explorer window
  • Directly we can not put shortcut to this feature, but setting shortcut to Last launched external Tool, we can put as follows:
    enter image description here

Premraj
  • 72,055
  • 26
  • 237
  • 180
1

Adding Show in Nautilus using External Tools is pretty easy too, very similar to the process for Windows in VonC's answer. Simply create the following shell script, chmod +x it and add it to the PATH. Then use it in Eclipse's External Tools Configuration window, as shown in the screenshot below.

~/bin$ cat run-nautilus.sh 
#!/bin/bash
nautilus `dirname $1`

Set up the external tools configuration as shown here

Sufian
  • 6,405
  • 16
  • 66
  • 120
sigint
  • 1,842
  • 1
  • 22
  • 27
0

I cannot seem to comment, so I will post as an answer instead On OSX the answer @zvikico is very close, I would change it to:

Location: /usr/bin/open
Arguments: -R ${container_loc}

The -R argument is a reveal in finder argument, as opposed to actually trying to open the file.

Then you just Run As Shell as mentioned in the other external tool answers

Sufian
  • 6,405
  • 16
  • 66
  • 120
TomC
  • 139
  • 2
  • 12
0

How to use the EasyShell plugin in Eclipse to quickly jump to, find, or copy the path of a file or folder

Use the EasyShell plugin. I love it--it's really great for this!

Install it, then right-click on the project in the Project Explorer and go to Easy Shell --> "Open with Default Application", "Copy full path to clipboard", or "Copy qualified name to clipboard":

enter image description here

Choosing "Copy Full Path..." might copy this path:

/home/gabriel/Downloads/Install_Files/Arduino/arduino-1.8.12/libraries/Mouse/src/Mouse.cpp

while "Copy Qualified Name" might copy this, which starts with the Eclipse project name as the root of the path:

/arduino-1.8.12/libraries/Mouse/src/Mouse.cpp

Choosing "Open with default Application" will open the file or folder in your default file manager, such as Windows Explorer in Windows, or Nautilus or Nemo in Linux.

Going further

  1. Ubuntu's default file manager is Nautilus, but I really hate that file manager, so I upgraded mine to Nemo on all of my Linux machines, as I explain here: How to install Nemo and set it as the default file manager in Ubuntu 18.04, 20.04, etc.. Jump to the end of my answer in the section titled "Why use nemo over Ubuntu's default nautilus file manager?" to see screenshots and why I love nemo so much more. I actually ended up moving from Windows to Linux finally on all my machines, even for my kids, in part because of the beauty and utility and time-saving and ease-of-use offered by the nemo file manager. Furthermore, MacOS's horrific and cumbersome file manager is one of the reason's I can't switch to Mac.
  2. I have documented other Eclipse plugins I really like in my document here, under the section "Plugins to Install": Eclipse setup instructions on a new Linux (or other OS) computer: Plugins to Install
Gabriel Staples
  • 36,492
  • 15
  • 194
  • 265