Posted by robloach on January 11, 2008 at 8:54am
Eclipse is a very powerful IDE. Having it work with Drupal requires installing Eclipse PDT, and then configuring it. Although it's easy to download and use the All-In-One Eclipse PDT, I wanted to start from Eclipse Classic and install what Drupal uses on top of it.
PHP and JavaScript
- Download and install Eclipse Classic
- Help --> Install New Software... Click on "Available Software Sites" and add the following...
- Galileo: http://download.eclipse.org/releases/galileo
- Eclipse 3.5 Update: http://download.eclipse.org/eclipse/updates/3.5
- Work with "All Available Sites", and enable the following features:
- PHP Development Tools (PDT) SDK Feature
- JavaScript Developer Tools
Subversion
- Add the following repository: http://subclipse.tigris.org/update_1.6.x
- Enable the following features:
- Subclipse
- Subversion Client Adapter
- Subversion JavaHL Native Library Adapter
- SVNKit Client Adapter
- SVNKit Library
EDIT: Updated on February 11th, 2010.

Comments
Thanks Rob
I had never tried JSEclipse before. I'll give it a spin.
Any settings recommendations to consider for it?
Cheers.
Questions:
First, thanks for making adding sites to get plugins import easier!
And straight on to asking for more!
Thanks,
benjamin, Agaric Design Collective
benjamin, agaric
Answers:
Thanks for trying it out! I forgot to put a step in there to configure the IDE once everything is installed.
OK, Let's see if I can describe these steps as I did them
Please correct if anything looks wrong!
So I've used Help »
and then Configuration to disable PHPEclipse.
File » New » Project
Click the arrow next to the CVS folder, and select Projects from CVS
and click the Next button.
This is how I filled out the resulting form:
Host: cvs.drupal.org
Repository path: /cvs/drupal (note the preceding slash, not cvs/drupal nor just /cvs)
User: anonymous (For Drupal itself, unless you're a big shot, you can't use your own CVS username and password.)
Password: anonymous
Left the connection type at pserver.
Next page:
Use a specified module name: drupal (Note this is a module in the CVS sense, not necessarily the Drupal sense!
And then I can tell it to check into a new PHP project if I remember to click Next and not Finish.
But I get Drupal 6 every time! How do I tell it to give me Drupal 5?
benjamin, agaric
This would seem to be the answer
Create an Eclipse project file for Drupal like this one (or just use this one) described here:
Eclipse team project set to checkout Drupal & contributions for 4.6, 4.7, 5.0 and CVS
UPDATE: Nope, this doesn't do it for me either.
I created a file with just:
<?xml version="1.0" encoding="UTF-8"?><psf version="2.0">
<provider id="org.eclipse.team.cvs.core.cvsnature">
<project reference="1.0,:pserver:cvs.drupal.org:/cvs/drupal,drupal,drupal-5,DRUPAL-5"/>
</provider>
But it insists on trying a username that I know doesn't work! And I don't know how to delete from the repository connection list it's drawing from. Throwing 'anonymous' anywhere around pserver in the reference line above doesn't help, I get an unknown error from the repository.
And pringing the /cvs/drupal,drupal,drupal-5 ... comma separated line or any variation back over to the straight CVS import dialog doesn't work either.
This is maddening. Anyone doing Eclipse PDT (maybe on a Mac) and maybe able to give the exact details?
benjamin, Agaric Design Collective
benjamin, agaric
checkout drupal 5 in eclipse
Just go to the next page.
The page after "Check Out As" (what you described above, where you can choose how to check out folder 'drupal'.) is page "Select Tag". Click "Refresh Tags" button and you will see the DRUPAL-5 branch also..
symlink in windows
If someone want to use symlinks under windows, then check out this application: Junction (By Mark Russinovich) http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx
the proper way
I recommend using apache virtual hosts even on your local machine.
the step by step instructions for windows users:
http://www.thewatchmakerproject.com/journal/378/virtual-hosts-and-the-pr...
Eclipse
Eclipse is great, the only annoying thing for me is the missing -p parameter for Unified diff command, when creating patch..
Thank you
Thanks, Rob, for the helpful instructions. After procrastinating for months, I finally started to set up a work environment for my Drupal development. The checklist did not work for me (Win XP SP2, Eclipse SDK 3.3.1.1 win32, Eclipse PDT, JSEclipse). I got an error while trying to install the PDT feature:
PDT Feature (1.0.2.v20080102-79-7GE7QYGHNGPGY) requires feature "org.eclipse.wst (2.0.0)", or compatible.Selecting the "Europa Discovery Site" on step 6 of your walkthrough, as suggested somewhere on IRC did not resolve the problem at first and the "Select required" button did not help either. However, after expanding (without selecting) the "Europa Discovery Site", "Select required" automatically selected the following items for me:
Enabling Features/Eclipse Modeling Framework (EMF) - org.eclipse.emf.common 2.3.0.v200709252135Enabling Features/Eclipse Modeling Framework (EMF) - org.eclipse.emf.common.ui 2.3.0.v200709252135
Enabling Features/Eclipse Modeling Framework (EMF) - org.eclipse.emf.ecore 2.3.0.v200709252135
Enabling Features/Eclipse Modeling Framework (EMF) - org.eclipse.emf.ecore.edit 2.3.0.v200709252135
Enabling Features/Eclipse Modeling Framework (EMF) - org.eclipse.emf.edit 2.3.0.v200709252135
Enabling Features/Eclipse Modeling Framework (EMF) - org.eclipse.emf.edit.ui 2.3.0.v200709252135
Enabling Features/XML Schema Infoset Model (XSD) - org.eclipse.xsd.edit 2.3.0.v200709252135
Graphical Editors and Frameworks/Graphical Editing Framework 3.3.1.v20070814
Models and Model Development/XML Schema Infoset Model (XSD) - org.eclipse.xsd 2.3.1.v200709252135
Web and JEE Development/Web Standard Tools (WST) Project 2.0.1.v200709110510-7C-778k0JWNr93WEIHvplSVojWel
I ended up with a working 200 MB Eclipse installation.
TheEasyEclipse for PHP distribution may be an alternative. Also, I stumbled upon PDT all-in-one packages. I did not check them out but maybe they are worth a try.
Same error w/europa
I had same w/europa this past week.
I had much better luck with PDT all in one install.
Problems
If you have troubles installing the Eclipse PDT plugin, install PHPEclipse instead. Although somewhat older, PHPEclipse still works very well. I actually like PHPEclipse more then EclipsePDT.
Subclipse is also a good one to install if you have a SVN repository: http://subclipse.tigris.org/
How To Link
Rob,
Great start. For a more detailed explanation, I found this online which could be helpful if you are running Eclipse 3.4 - Had it up and running in about 20 minutes.
http://www.howtoforge.com/setting-up-eclipse-pdt2.0-on-eclipse3.4-ganymede
Kenny Silanskas
Proud Member of the Acquia Support Team
That's a handy link, it does
That's a handy link, it does look like it'd get you through in pretty quick order. There are a couple problems with it, though, although more nitpicky than anything. In fact, I'd say that if your Eclipse works when following those instructions, then ignore this, b/c Eclipse is finicky, so if it ain't broke don't fix it!
One of the interesting
One of the interesting things that's come about as a result of the new provisioning system in Ganymede (p2 it's called) is that it's now quite possible to set up our own update sites. They can reference existing repositories, so there's no need to mirror all the files ourselves, but we can also add a little bit of our own data as well.
Nifty point #2: it's now possible to use standalone instances of the p2 provisioning system to install a whole eclipse install, using one of these update sites, and starting with only a 4MB download. Scroll down to the 'Provisioning' section here: http://download.eclipse.org/eclipse/equinox/drops/I20080806-0815/index.php. I tend to run the Integration builds in general, but it's probably extra-important here, as p2 is still having kinks worked out.
What all this really amounts to is that sometime in the very near future, we'll have a custom-tailored Drupal Eclipse install that will be as simple for people as:
Included in such a 'Druclipse' setup, as I'm already affectionately calling my local copy of this beast, would be everything in this list: http://www.howtoforge.com/setting-up-eclipse-pdt2.0-on-eclipse3.4-ganymede, as well as pre-set up anonymous CVS accounts pointed at the core and contrib repos, a tweaked eclipse.ini for better performance (the eclipse.ini that comes by default with all eclipse downloads is a performance DOG). Hell, if I can figure it out, we can probably roll the jdbc drivers in there that you need to make postgres and mysql work from within Eclipse. And once we get some Mylyn integration with Project*...man, it'll be OVER :)
PDT 2.0 is scheduled to be released on Sept. 15th; I estimate I'll probably have a basically functioning update site around the time of Szeged, which means that things should be pretty well ready to roll out by the time that PDT 2 is formally released.
So...yeah, this is a project that clearly I'm steaming ahead with, but it'd be great to get some help if anyone has time to spare and is so inclined. Especially if you have java experience.
eclipse for drupal with pdt on windows vista
Hi sdboyer,
I decided to follow along with your suggested installation. I am posting my notes below. This is for n00bs like me who are not familiar with Eclipse and the weird universe that is unix 'documentation'.
I think your custom package is a great idea. I look forward to it.
So here's what i did installing eclipse for drupal on vista, following along with your notes:
1.a Download this 4meg file.
As you said, the install package can be found at:
http://download.eclipse.org/eclipse/equinox/drops/I20080806-0815/index.php
Go to Provisioning (use search, it's a long way down).
There are 2 lines with downloads for Windows. The larger file is an "agent"-package. The smaller file is the installer package. I chose the installer package.
1.b Execute it.
I unpacked the installer package.
I opened the folder eclipse.
I executed p2installer.exe as administrator (I'm on Vista).
2. Pick from a couple well-explained (I hope...haven't investigated how flexible that part is yet) options in the updater re: which components you want to install.
An installer dialogue popped up:
I chose C:\Program files\eclipse
I chose shared install.
I got a message from my firewall and allowed all traffic for p2installer.exe.
I executed p2installer.exe again.
3. Grab some breakfast, maybe have a walk, because the update sites can be wankers and go really slowly.
Halfway through, where it said:
I got the following message:
I closed the message and I executed p2installer.exe again. This time I chose
The installation finished:
I clicked Launch.
4. Come back and find a solidly functional Drupal-tailored custom Eclipse install.
Eclipse Ganymede started.
A Dialogue appeared:
I browsed to my workspace folder.
I selected the option
and clicked ok.
I closed the welcome screen.
5. PDT
I next went to http://download.eclipse.org/tools/pdt/downloads/.
I downloaded the most recent Integration Build.
I unpacked the file.
In eclipse, I went to
and clicked
and in the new Dialogue I clicked on
, browsed to my unpacked PDT project folder and clicked OK.
A new line to my local copy of the PDT integration build had appeared. I checked it and clicked on Install....
When asked to restart eclipse I answered Yes.
6. Configuring eclipse
I went to http://drupal.org/node/75242 (Configuring Eclipse) and followed along.
7. The other stuff
Of course, you pointed to the article Set Up Eclipse PDT 2.0 On Eclipse 3.4 (Ganymede) at http://www.howtoforge.com/setting-up-eclipse-pdt2.0-on-eclipse3.4-ganymede.
Having installed PDT already, I now followed the instructions for the installation of:
- database
- webtools
- PDT > Dynamic Languages Toolkit
- PDT > Graphical Editing Framework
Because I am going to review the IDE first, I have not installed the Remote Tools for now. But I now know that I can get them here when I need them.
I now seem to have a working environment as well. Cheers!
Anyway to tell PDT that not having a closing '?>' is ok??
Developing a drupal 6 module... which cannot have the PHP tag closed. Anyway to tell PDT that not having a closing '?>' is ok??
Yes
In Eclipse preferences, go to PHP | Editor | Templates. Edit the "New simple PHP file" template and remove the closing tag.
Yes
On the latest 3.4 of Eclipse, PDT has a checkbox for completing the closing php tag.
FYI
The close php tags checkbox is located under Window->Preferences->PHP->Editor->Typing on Eclipse Helios (3.6.1) for Windows.
Pulse profile management
I work in a number of location and I use pulse to manage my install profiles for eclipse, its free for individuals and has extra options if you decide to pay for a license, I find it is useful for keeping track of what software I have installed and making sure it's the same on different workstations.
http://www.poweredbypulse.com
anyone able to get xdebug on
anyone able to get xdebug on a remote server working with eclipse pdt for your drupal debugging pleasure? if so, please share!
XDebug
I haven't tried it myself, but have you seen this post? http://ocdevel.com/blog/debug-drush-eclipse
xdebug.remote_enable = 1
As far as i remember, there is not much todo besides turning on remote on xdebug settings ( xdebug.remote_enable = 1 )
Project layout
How do you guys do it ? do you create a project with a full drupal project and then code your module inside, or do you create a project for your module and make it depend on a full drupal project ?