How to Add Existing Files to Eclipse Projects
Join the DZone community and get the full member experience.Join For Free
this tip sounds very basic, but still: i get asked about this about once a week. so it must be something non-obvious in eclipse then ;-): how to add existing files to an eclipse project. as with many things in eclipse, there is not a single way to do something. there are two basic ways to do this:
- drag & drop
- copy & paste
the first is the ‘official’ way in eclipse, the other two are much faster and easier :-).
to import one or multiple files, select the folder/project where i want to add the files, then use the menu file > import :
alternatively, i can use the context menu:
then use general > file system :
in the next dialog, i can browse for the files and select them to be added:
2. drag & drop
while the ‘import’ method is fine, i rarely use it: too many clicks! a easier way (at least under windows) is to drag & drop the files from the windows explorer:
3. copy & paste
the third way is even easier:
- select the files i want to add in the explorer/file manager, and copy them ( ctrl-c on windows)
- paste them in the project/folder in eclipse ( ctrl-v on windows)
that last method does not advanced options like if i want to link to the files, see “ link to files and folders in eclipse “, but is definitely the fastest and easiest way.
happy adding :-)
Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.