DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Exporting and Importing Projects in Eclipse

Exporting and Importing Projects in Eclipse

Erich Styger user avatar by
Erich Styger
·
May. 10, 22 · Java Zone · Tutorial
Like (7)
Save
Tweet
126.30K Views

Join the DZone community and get the full member experience.

Join For Free

I admit that I have (a few? or not so few) bad habits: one of them is that usually, I find a way to do things, and if that works, I stick with it. I know that there are other ways to do things, but hey, why bother? and sometimes a good friend asks an excellent question (are there any bad questions?), and this lets me review the way I’m doing things. and here is such a thing: exporting and importing projects in eclipse.

Archive Files With Drag & Drop

Here is how I usually move or copy a project to another machine:

  1. Find the project place on my hard disk. an easy way is to select the project folder and use the context menu with  show in windows explorer 
  2. Zip that projects into an archive file
  3. Delete from that archive file any derived resources (see  dissection of mcu10 projects  ), as well as remove all the version control information.
  4. Copy the archive file into the destination workspace and unzip it there
  5. Then drag&drop that folder into eclipse: this will import that project into the workspace. Instead of the folder I simply can drag&drop as well the  .project  file

note: best if i drag&drop the project into the ‘codewarrior projects’ view. this will  not  work if i drop it into the processor expert ‘project panel’ view.

well, that works, and I really get used to that process. so why bother? because there is actually a better way: to export and import.

The Export and Import Way

1. Select one or more project and use the ‘export’ context menu or file > export. Here select general > archive file:

export project as archive file

export project as archive file

2. In the ext dialog, you can deselect files and folder. additionally, you need to specify the archive file. You could use  filter types (e.g. to include *.c and *.h).

 I really wish that this dialog would consider the ‘derived’ flags for files and folder, so I could deselect them easier.

archive file settings

archive file settings

3. In the destination workspace, use the menu  file > import :

import dialog to import a project

import dialog to import a project

and here is the stumbling point:  Do  not  (!) select ‘archive file’, but ‘   existing projects into workspace   ‘.  I have exported it as archive file, but importing an archive file is importing an archive file  inside a project  , not (!)  as a project  . This is a usability quirk in eclipse.:-(

4. In the next dialog, you can choose the archive file and make adjustments which project you want to import. Note that it will automatically copy the projects into my workspace.

import archive projects

import archive projects

5. Click finish, and the projects get imported.

Summary

I'm using combinations of both ways: the archive file produced by the export is not different from an archive file I create with my  winzip  archive utility (or any other tool like this one). for both export ways, I need to manually remove what I do not want in the archive file. I wish there would be better support for this. but for importing projects the import functionality is really good, as it avoids the copy/extract/drag&drop way: I can go through two dialogs, and that’s it.

happy export-import :-)

ps: thanks to mark ruthenbeck having me considering more the export/import way!

Archive file Eclipse

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 12 Kick-Ass Software Prototyping and Mockup Tools
  • Modernize Legacy Code in Production: Rebuild Your Airplane Midflight Without Crashing
  • Why Is Software Integration Important for Business?
  • After COVID, Developers Really Are the New Kingmakers

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo