12

This 'solution' doesn't look to work any longer in the Luna version: Copy path/file name in Eclipse to clipboard

This is actually a must have feature for a rich IDE!

Community
  • 1
  • 1
jaques-sam
  • 2,578
  • 1
  • 26
  • 24

3 Answers3

10

You can use start explorer (alternate link) or Copy path plugin.
Short cut key to copy path to clipboard in star explorer is : Ctrl+Alt+ C

Standard eclipse eclipse doest have such key. You can select resource in Package/Project/Navigator view and press Alt+Enter to open property dialog and then copy path from here.

Gabriel Staples
  • 36,492
  • 15
  • 194
  • 265
Chandrayya G K
  • 8,719
  • 5
  • 40
  • 68
  • Thank you for the comment! I installed the copy path plugin were you simply have those buttons on top. That's just what I needed!! – jaques-sam Jan 06 '15 at 14:38
  • Unfortunately neither of these plugins work on the latest Eclipse version, which is 4.14 as of Dec 2019. Any other alternatives? – Gabriel Staples Jan 07 '20 at 09:56
  • Solved: https://stackoverflow.com/questions/27022313/how-to-quickly-copy-the-current-editing-file-name-or-full-file-path-in-eclipse/59626187#59626187 – Gabriel Staples Jan 07 '20 at 10:08
4

I am using Eclipse Java EE IDE for Web Developers.Version: Luna Release (4.4.0) Build id: 20140612-0600

You can right mouse click on the file and select "Copy Qualified Name".

enter image description here

For this particular example, the path in clipboard is

/TestingProject/src/com/website/testing/App1.java

BustedSanta
  • 1,368
  • 7
  • 28
  • 55
1

Use the EasyShell plugin

If using Eclipse 4.14 or later, from Dec 2019 or later, neither StartExplorer nor Path Tools nor Copy as Path works.

Instead, use EasyShell, which works great!

Instructions:

  1. Unsure no text or code is selected.
  2. Right-click anywhere in your open Eclipse file editor, including on empty space near your code, or in the Project Explorer pane.
  3. Go to "EasyShell" --> "Copy Full Path to Clipboard", or "Copy Qualified Name to Clipboard" (see screenshot below).
  4. You now have the file path copied. Paste it wherever you want.

enter image description here

Totally unrelated aside

Additional note: as far as good Ecliplse plugins go in general, I also highly recommend the DevStyle plugin, set to "Dark Gray (Darkest Dark)" Workbench theme, with the DevStyle "Editor theme" (syntax highlighting) set to Sublime Text 3 (Monokai), by Jeremy Shepherd <-- Update Feb 2020: dead links. Instead, I've copied and pasted the contents of Jeremy Shepherd's .xml file at the bottom of this answer.

enter image description here

Sublime Text 3 (Monokai) - by Jeremy Shepherd--theme-25808.xml:

<?xml version="1.0" encoding="utf-8"?>
<colorTheme id="25808" name="Sublime Text 3 (Monokai)" modified="2014-04-11 19:52:55" author="Jeremy Shepherd">
    <searchResultIndication color="#757575" />
    <filteredSearchResultIndication color="#757575" />
    <occurrenceIndication color="#000000" />
    <writeOccurrenceIndication color="#000000" />
    <findScope color="#111111" />
    <deletionIndication color="#D25252" />
    <sourceHoverBackground color="#000000" />
    <singleLineComment color="#75715E" italic="false" />
    <multiLineComment color="#75715E" italic="false" />
    <commentTaskTag color="#CCDF32" italic="false" underline="true" strikethrough="false" />
    <javadoc color="#76725E" italic="false" />
    <javadocLink color="#76725E" italic="false" underline="true" strikethrough="false" />
    <javadocTag color="#FD2971" italic="false" />
    <javadocKeyword color="#C2BFA6" italic="false" />
    <class color="#56D8F0" bold="false" underline="false" strikethrough="false" />
    <interface color="#D197D9" />
    <method color="#FFFFFF" />
    <methodDeclaration color="#7BE12A" />
    <bracket color="#D8D8D8" />
    <number color="#7FB347" />
    <string color="#E7DD6C" />
    <operator color="#D8D8D8" />
    <keyword color="#F12971" bold="false" />
    <annotation color="#FFFFFF" />
    <staticMethod color="#BED6FF" />
    <localVariable color="#E7F8F2" />
    <localVariableDeclaration color="#F12971" />
    <field color="#7BE12A" />
    <staticField color="#EFC090" />
    <staticFinalField color="#EFC090" />
    <deprecatedMember color="#D25252" underline="false" strikethrough="true" />
    <enum color="#7BE12A" />
    <inheritedMethod color="#BED6FF" />
    <abstractMethod color="#BED6FF" />
    <parameterVariable color="#79ABFF" />
    <typeArgument color="#BFA4A4" />
    <typeParameter color="#BFA4A4" />
    <constant color="#EFB571" />
    <background color="#272822" />
    <currentLine color="#3E3D32" />
    <foreground color="#F8F8F2" />
    <lineNumber color="#72736A" />
    <selectionBackground color="#757575" />
    <selectionForeground color="#D0D0D0" />
</colorTheme>

Sublime Text 3 (Monokai) - by Jeremy Shepherd--theme-25808.epf:

Too long to post here. See my dotfiles project to download it instead.

Gabriel Staples
  • 36,492
  • 15
  • 194
  • 265