Copy path/file name in Eclipse to clipboard

There is yet another plugin that supports copying the path along with a number of other related functions:

http://code.google.com/p/pathtools/

Just search Eclipse Marketplace within Eclipse for 'pathtools'.

enter image description here


You can do it with a single keystroke by configuring an Eclipse external tool (a much underused tool in my opinion). Takes about a minute to configure the first time you use it but then it's always available. Here's a YouTube video demonstrating the technique.


There is Copy Qualified Name function in Eclipse, it will copy the full name of the element you select (or element on cursor).

For example :

/MyProject/src/app/Application.java : when you select Application.java in Package Explorer

java.util.HashSet<String> : when you copy while cursor at HashSet<String>

However, it required you to select the element you want.

So, here is what I do.

  1. Make your Package Explorer link with editor, you can active this by click the double-arrow icon at top-right corner.

  2. Set up a hot-key for Show View (Package Explorer) ex : Alt + 1

  3. Set up a hot-key for Copy Qualified Name ex : Alt + Ctrl + Shift + c

Whenever I need these information in current file, I just press the hot-key to call my Package Explorer Since it links with editor and will always select the file in current editor, you can just copy with the hot-key. Then you can use F12 back to your editor, or simply ESC if you use fast view.

Not perfect, but it works :D


  • Just select the file tab and hit Ctrl+C to copy file basename into clipboard.
  • Hit Alt+Enter to bring up the file properties with absolute path and copy it manually.
  • Additionally you can use an Eclipse macro plugin that can do the steps in one go: http://sourceforge.net/projects/practicalmacro/files/