Agaric Design Collective

Getting trained by Eclipse PDT: Opening an existing folder of files as a project

By Benjamin Melançon
on 30 Jul
2 comments

Key words and phrases

Eclipse PDT new PHP project from directory import project from source use existing code for PDT project

Tags

Description

So you have a directory structure of a project, say it's a giant site you're taking over, and you want to open it as a project in Eclipse PHP Development Tools (PDT) to be able to use the project-wide search and other cool tools.

I just spent an hour trying to do it through File » New PHP Project and then naming the existing spot in the file system for the folder with all the code. This did not work. It completed without error, but if it were even creating the project I have no idea where it was putting them.

Creating a project in the default location did work.

File » New PHP Project with "Use defaults" under project contents.

Then, as a second step:

File » Import and under "General" select "File System". Let it grab your folder full of files (and subdirectories etc) wherever it is on your computer, and import it into your project at the default location.

Classify this as a workaround rather than actually knowing how it should work. But hey, at least it works. Humor Eclipse PDT; it will usually be worth it.

 

The way to do this is

The way to do this is explained on this page:

http://www.cotonti.com/page.php?al=eclipse_pdt_howto

It says:

To import an existing project on your hard disk to Eclipse, do the following:
a. Copy .project file into the root of your project folder from some existing project. Edit this file and set new project name.
b. Open Eclipse and run File => Import => General => Existing Project into Workspace.
c. Locate your project on hard disk, make sure it appears in "Projects" combo and hit "Finish".

In other words, you copy the ".project" file from the folder of existing project (you can make a new project in Eclipse just to generate the .project file to copy), copy it into the folder where your existing files are, open the .project file (in notepad etc) and change the value in ... to the name you want to use for the project. Then you can import it properly in Eclipse.

Posted by Visitor (not verified) on Wed, 2010-01-13 16:03
You also need to copy the

You also need to copy the file ".buildpath" for the PHP Functions panel to work correctly.

Posted by Visitor (not verified) on Wed, 2010-01-13 18:31
Post new comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <small> <pre> <strike> <sub> <sup> <kbd> <s>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.