Drupal Eclipse

Events happening in the community are now at Drupal community events on www.drupal.org.
robloach's picture

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

  1. Download and install Eclipse Classic
  2. Help --> Install New Software... Click on "Available Software Sites" and add the following...
  3. Work with "All Available Sites", and enable the following features:
    • PHP Development Tools (PDT) SDK Feature
    • JavaScript Developer Tools

Subversion

  1. Add the following repository: http://subclipse.tigris.org/update_1.6.x
  2. 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

amanuel's picture

I had never tried JSEclipse before. I'll give it a spin.

Any settings recommendations to consider for it?

Cheers.

Questions:

mlncn's picture

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:

robloach's picture

Thanks for trying it out! I forgot to put a step in there to configure the IDE once everything is installed.

Do you recommend getting the latest nightly releases for PHPEclipse instead of stable (I had http://phpeclipse.sourceforge.net/update/releases instead)?
Either the stable or nightly releases work. If you're having troubles with the nightly release, try the stable one.
Do you simply recommend PDT over PHPEclipse?
From what I can tell, Eclipse PDT is the official implementation of PHPEclipse. Looking at the news and bug reportings in PHPEclipse, it seems like the focus has moved to Eclipse PDT. Not to mention that Eclipse PDT is featured on the official Eclipse site and PHPEclipse is hosted on SourceForge. Eclipse PDT is what you should use is you're running Eclipse 3.3 or higher, and PHPEclipse is what you should be running if you're running Eclipse 3.2 or lower (this is due to some Java library requirement or something). They arn't that much different though, so don't be too concerned.
And above all, what is your practice for using with MAMP/XAMP/WAMP and developing Drupal modules and sites? (Checkout into the httdoc directory? Symlink? Etc.!) Matthew Pare has asked this better, here: How to Succesfully Incorporate Eclipse IDE into a Drupal Workflow.
That's actually exactly the practice I use. I checkout Drupal as a new PHP project using Eclipse from the Drupal CVS, and then create new projects under sites/all/modules that will be experiencing development, and then commit the changes that were made when everything is working. Every module becomes its own project, with unique a CVS address. When I want the changes to reflect the live site, I remotely checkout the CVS module that I was just working on. This IDE is great!

OK, Let's see if I can describe these steps as I did them

mlncn's picture

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

mlncn's picture

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

pasqualle's picture

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

pasqualle's picture

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

pasqualle's picture

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

pasqualle's picture

Eclipse is great, the only annoying thing for me is the missing -p parameter for Unified diff command, when creating patch..

Thank you

Linulo-gdo's picture

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.v200709252135
Enabling 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

dlhubler's picture

I had same w/europa this past week.

I had much better luck with PDT all in one install.

Problems

robloach's picture

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

webkenny's picture

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

sdboyer's picture

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!

  1. The PDT devs explicitly recommend that certain versions of the PDT dependencies be used in association with certain builds. Ex: tonight's nightly (http://download.eclipse.org/tools/pdt/downloads/release.php?release=N200...), where they include links to all of those specific builds. Sometimes the built in Ganymede repo will provide you these versions, other times it won't.
  2. Subclipse isn't quite as feature-rich as Subversive, although it does adhere more closely to svn standard behavior as it regards adding/deleting files from repos.
  3. Those folks are living in the past when it comes to adding local sources in Eclipse. As of 3.4, you should really never have to add local sites anymore - that's what that new, nifty 'dropins' folder is for in your Eclipse directory - if you unzip files into there (personally, give each plugin its own subdirectory in dropins to keep everything clean), then the p2 provisioner will pick them up when Eclipse is run, and calculate all the metadata just like a normal remote update site. It's kinda kickass.

One of the interesting

sdboyer's picture

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:

  1. Download this 4meg file. Execute it.
  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.
  3. Grab some breakfast, maybe have a walk, because the update sites can be wankers and go really slowly.
  4. Come back and find a solidly functional Drupal-tailored custom Eclipse install.

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

whatdoesitwant's picture

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:

Location 
- Select the product install directory

I chose C:\Program files\eclipse

Layout
- Shared Install or Stand Alone Install

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:

Downloading org.eclipse.swt

I got the following message:

An error occurred while collecting items to be installed.

I closed the message and I executed p2installer.exe again. This time I chose

Stand alone install

The installation finished:

Install complete. Do you want to start Eclipse SDK Immediately?

I clicked Launch.

4. Come back and find a solidly functional Drupal-tailored custom Eclipse install.
Eclipse Ganymede started.
A Dialogue appeared:

Workspace launcher
- Select a workspace

I browsed to my workspace folder.
I selected the option

Use this as the default and do not ask again.

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

help > Software updates... > Available software

and clicked

Add sites

and in the new Dialogue I clicked on

Local

, 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!

kurtfm@gmail.com's picture

Developing a drupal 6 module... which cannot have the PHP tag closed. Anyway to tell PDT that not having a closing '?>' is ok??

Yes

deekayen's picture

In Eclipse preferences, go to PHP | Editor | Templates. Edit the "New simple PHP file" template and remove the closing tag.

Yes

davea's picture

On the latest 3.4 of Eclipse, PDT has a checkbox for completing the closing php tag.

FYI

bethhauck's picture

The close php tags checkbox is located under Window->Preferences->PHP->Editor->Typing on Eclipse Helios (3.6.1) for Windows.

Pulse profile management

tdos20's picture

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

jaypark's picture

anyone able to get xdebug on a remote server working with eclipse pdt for your drupal debugging pleasure? if so, please share!

XDebug

bethhauck's picture

I haven't tried it myself, but have you seen this post? http://ocdevel.com/blog/debug-drush-eclipse

xdebug.remote_enable = 1

redben's picture

As far as i remember, there is not much todo besides turning on remote on xdebug settings ( xdebug.remote_enable = 1 )

Project layout

redben's picture

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 ?

Drupal IDE

Group organizers

Group categories

Drupal IDE Tags

Dev Software

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week