Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an equivalent of "Add existing file" (to project) in Eclipse?

Tags:

eclipse

I am trying to map my Visual Studio experience onto Eclipse. Right now, I wish to add a file existing somewhere on the file system into a project in Eclipse. I expect it to be copied to the project source folder.

Currently, I see only one way - switch to the windows explorer (total commander, in my case) and copy the file myself, after which to refresh the project.

Can I do the same without leaving the Eclipse IDE?

Thanks.

like image 736
mark Avatar asked Nov 24 '11 08:11

mark


People also ask

How do I add an existing folder to Eclipse?

You can link to a folder by using the Advanced option on the New->Folder dialog or drag/drop the folder from a file system navigator (Explorer,Nautilus, etc) onto your project in Eclipse. You will get an option to copy the folder or link to it in the file system.

How do I add a file to a project?

On the Project Explorer, select the Files tab, right-click the node associated with the type of file you want to add, and then click Add File. For example, to add a script file to the project, right-click Script, and then click Add File.

How do I open an already imported project in Eclipse?

You need to use "File"->"Import"->"General"->"Import Existing Project" to be able to use your existing project.


2 Answers

I had the same problem, but found yet another solution.

Let me state my problem so that we're sure we're talking about the same thing.

I had a file in a directory where a bunch of code files were and some of the files in that directory were shown as "in my project" and some of the files were missing. I wanted the missing files to appear in my project.

I simply selected the folder in my project and pressed 'F5' or right-clicked and selected 'refresh' and the files appeared in my project. It looks like that is the intended way of doing this.

like image 179
Pete P Avatar answered Sep 17 '22 12:09

Pete P


File->Import->General->File System should do it. There you can select the file(s) from some file system folder to your project (into folder).

like image 21
Uku Loskit Avatar answered Sep 21 '22 12:09

Uku Loskit