How to import an existing non-Eclipse project into Eclipse
I always seem to have issues organizing my projects in Eclipse.
It’s really convenient to have all my projects in one workspace, but then again it adds unnecessary complication with searching the workspace, closing/opening projects, etc. Recently I’ve sort of given in/up and reformatted my entire local workspace. What I did was I set the document root of my local Apache web server to “c:\” that way everything on the hard drive can use the server (as opposed to limiting all your projects to the “www” or whatever.) This should be a whole other issue, but I’ll elaborate if you’ll direct your attention to my (*)tangent below.
So the heart of my problem - Eclipse allows you to create a new project, then import an existing project or file system into the new project but not import an existing file system into the workspace AS a new project (as far as I can tell). And, just to give myself an out - IF there is a way to do this without a workaround (and please tell me if there is), Eclipse has either done a fine job of hiding it, or it’s so obvious that I’ve overlooked it for years/I’m an idiot.
So basically what I’ve done is created one workspace which will house all my new, existing, and imported projects going forward. The goal here is to add an existing client’s folder to the workspace which has no Eclipse project files in it prior. What you do is:
- Create a new project and give it whatever name you want, like “client abc”. If you already have a folder in the workspace file system named “client abc” then name your project something else like “client abc whatever”.
- Now close Eclipse and open explorer (if you’re using Windows)
- drag the “.buildpath” and “.project” files as well as the “.metadata” folder from the new project folder (”client abc whatever”) into the actual client folder (”client abc”).
- Now just delete the “client abc whatever” folder.
Now when you open Eclipse back up, you’ll see the project you just created, except when you look you’ll see it has all your project files in it.
I hope this helps. As always, at least it will help me if I for some reason forget how to do it later. Let me know if you have any questions.
(*)tangent: I always have kept my web server files and project files separate on my local drive. For example, I’ll have all my website files in the “www” folder, and all my other files in some other folder (ex: c:\projects\client ABC\mockups). I gave up on this annoyance about a month ago and am going for full consolidation instead. Here’s an example of an actual path on my drive: c:\…\Clients\Archives\BrownBearAndFriends\ - which I can now access from: http://localhost/…/Clients/Archives/BrownBearAndFriends/ - and all the project assets are stored here: c:\…\Clients\Archives\BrownBearAndFriends\Backup\.
“Backup” is probably sort of meaningless, but it’s consistent, and I’ve used it on every project so… so what.
UPDATE: Apparently the latest version of Eclipse is different. Details to follow soon - maybe.







No Comments, Comment or Ping
Reply to “How to import an existing non-Eclipse project into Eclipse”