tags:

views:

25

answers:

1

I have an Eclipse project. It originally had a structure something like this:

MyProj
   src
      myproj
          bar.java
          baz.java
          foo.java
          [etc.]

Earlier, I thought I wouldn't need baz.java anymore, so I deleted it from the project, which also deleted it from disk. Thankfully, subversion remembered the old version, because it turns out I DO need it, so now I've gotten it back into the source directory, but I can't seem to figure out how to add it back into the project.

I tried File -> Import, but that seems to only want to import directories.

I tried File -> New -> Java Class, but that creates a new, empty file.

I suppose I COULD copy my file off elsewhere, File -> New, then copy/paste it in, but I'd love to learn the CORRECT Eclipse way to add an existing file to my project.

Thanks!

[Edit: I'm on a Mac, 10.6.Latest, Eclipse Helois 20100617-1415, though I don't think it matters.]

+4  A: 

You should be able to just put them in the correct dir under your project(I think you stated SVN already replaced the file in the proper location), and hit File->refresh in Eclipse.

Edit: that wasn't working for me, I'm on a mac but I assume drag on drop should work platform independent and it was working for me.

Brian Huenefeld
Olie