Adding ‘Show in Windows Explorer’ to Eclipse

In CodeWarrior there was a very useful feature in the CodeWarrior Projects view: with a context menu I can open that folder/file in Windows Explorer:

Show In Windows Explorer in CodeWarrior Projects View

Show In Windows Explorer in CodeWarrior Projects View

However, this feature is missing in Eclipse, so how to add this functionality?

That ‘Show in Windows Explorer’ is really handy, as I can quickly jump to that file or folder where it is on the disk.

Emulating ‘Show In Windows Explorer’

I was looking for a way how to do this, and some solutions include installing an extra Eclipse plugin. But there is an easy way without installing anything with using an external run configuration.

Open the External Tools Configuration or use the menu Run > External Tools > External Tools Configuration:

External Tools Configuration Menu

External Tools Configuration Menu

Then, do the following:

  1. Select the ‘Program’ group
  2. Press the ‘new’ button to create a new configuration
Creating New External Tool Configuration

Creating New External Tool Configuration

In the new configuration:

  1. Give the configuration a name
  2. Specify the command line for the Explorer (on Linux, use your file explorer):
    ${env_var:SystemRoot}\explorer.exe
  3. As arguments, specify it shall use the selected resource:
    /select,${resource_loc}
  4. Press Apply to store the configuration
  5. Then I can Run it
Configuring the External Tools Configuration

Configuring the External Tools Configuration

If you have selected a resource, you will get an error:

Error for not selected a resource

Error for not selected a resource

So make sure you select a folder/file before running the command.

If you have run the command at least once, it is now easily accessible in the drop down menu:

Show in Windows Explorer

Show in Windows Explorer

Exporting Configuration

However, this is not a ‘global’ setting, and only applies to the workspace. So if you have multiple workspaces, you need to create an external tools configuration for each workspace. Or use the ‘Shared File’ option which stores the settings in a file:

Sharing External Tools Configuration

Sharing External Tools Configuration

Now I can copy that file .launch file to a project in my other workspace easily to have it imported.

Summary

There is no plugin needed for showing a file or folder in the host operating explorer view: an external tools configuration is good enough :-).

Happy Exploring 🙂

10 thoughts on “Adding ‘Show in Windows Explorer’ to Eclipse

  1. This is built into Eclipse with Luna (4.4) onwards. Select the resource, bring up the context menu, in the “Show in…” sub menu there is now a “System explorer” option.

    Older versions you can install a plugin such as StartExplorer to add it to the main context menu in a similar way to CodeWarrior – http://basti1302.github.io/startexplorer/

    Like

    • Just to confirm, Is the rest of “show in…” “..Remote Systems View”? That is the closest thing that I see.

      Selecting “Show in Remote Systems View” is pretty cool, and from the resulting folder tree view I was able to right click on my source code folder and open a shell from there by right clicking and selecting “Launch Shell”. From this shell, as was mentioned by another commenter, I could call make.

      It’s nice to know about all options. Thanks all!

      Like

  2. I am using another plugin – Easy Shell. Beside opening in explorer, you can make some other useful things, like opening command prompt or running.
    Another benefit is that it runs on Linux too.

    Like

  3. Thanks for the tip. This will come in handy.

    I’ve done this at work and home, and Build before launch, in the build tab, was checked by default. Other users may want to remember to uncheck this. I’ve also unchecked the Allocate console in the Common tab.

    Like

  4. For OS X and Eclipse versions < 4.4 (Luna), create an external program launch configuration as shown in this blog article. Name it "Show in Finder". Set "Location:" to "/usr/bin/open" (without the double quotes). Set "Arguments:" to '-a Finder.app "${container_loc}"' (with the double quotes but without the single quotes). You need to use "container_loc" and not "resource_loc", otherwise Finder will open the file using the default app (e.g., TextWrangler for "txt" files, if that's your default).

    In Luna, binding Control-Option-Command-F (OS X) to the "Show In (System Explorer)" command in the Keys preference pane makes accessing this feature very easy.

    Like

  5. Pingback: Show Eclipse Project Location in System Explorer | MCU on Eclipse

What do you think?

This site uses Akismet to reduce spam. Learn how your comment data is processed.