Using Eclipse for Web Development

As I alluded to on Twitter, Eclipse is a horrific scattered mess of projects masquerading as an IDE.  I only hear wonderful things about it, mostly from ColdFusion developers, but god help the person that assumes it will be a quick and easy installation.

First you need to choose the package you want.  I'm going to be writing PHP, ColdFusion, JavaScript, CSS, HTML files, and committing them to Subversion repositories.

Installation

Now, which package should I download?

The size differences alone give me pause, and the descriptions don't help at all.  Why is Eclipse Classic – which includes Java Development Tools – twice the size of Eclipse IDE for Java Developers?  Since I'm not writing anything in Java I'm going to choose Eclipse Classic.

Individual Package

I want syntax highlighting and code completion for PHP, ColdFusion, JavaScript, CSS and HTML.  I also want integrated SVN access.  This should be easy enough, let's get started.

ColdFusion

ColdFusion is easy, thanks to CFEclipse.  Well, almost. From the download page:

Important note regarding Eclipse 3.4 (Ganymede): Currently CFEclipse does not work well with Ganymede. We recommend you continue using Eclipse 3.3 (Europa) for a stable user experience.

I'm going to choose to ignore that, I don't like to run old software.  Add http://www.cfeclipse.org/update to the Software Update locations, select your packages (not CFUnit), click Install and restart Eclipse.

PHP

PHP is not so easy.  There are three options; PDT, PHPEclipse and Zend Studio for Eclipse.  Zend is of the main contributors to PDT, and even offers a handy comparison between Zend Studio and PDT.  Oh, Zend Studio (for Windows) is 317MB whereas PDT is 7.8MB. Or maybe it's 122.5MB.

We're starting to see where in my opinion, Eclipse falls apart.  PDT All-In-One includes Eclipse 3.3 and the dependencies.  The latest version of Eclipse is 3.4.1.  Oh and Zend Studio for Eclipse?  It's not for Eclipse, it's a custom Eclipse bundle. Zend Studio on Eclipse would be more accurate.

Let's take a look at the PDT install documentation. Obviously we want to install from an update site, an automated installation has to be easier than downloading a zip file.

From Update Site

  • Get Eclipse:
  • Start the Install Manager. You will require three update sites to perform an install of PDT 2.0.

Help > Software Updates… > Available Software > Manage Sites…
Add… > add the DLTK 1.0 interim site: download.eclipse.org/technology/dltk/updates-dev/1.0/
Add… > add the PDT 2.0 interim site: download.eclipse.org/tools/pdt/updates/interim/
Enable the Ganymede Update site (if not already enabled): download.eclipse.org/releases/ganymede/
Expand the DLTK site and select the Dynamic Languages Toolkit – Core Frameworks or Dynamic Languages Toolkit – Core Frameworks SDK Feature
Select the PDT or PDT SDK Feature
Install…

Wait, why do I need the Ganymede JEE Bundle? What's wrong with the Eclipse Classic bundle we downloaded before?  According to the Eclipse site the JEEE bundle is "Tools for Java developers creating JEE and Web applications". I'm developing in PHP, not Java.  Since the answer isn't on the PDT or Eclipse sites I'm going to take a pass and install PHPEclipse.  Add http://update.phpeclipse.net/update/stable/1.2.x to your Software Update sites, and I installed PHPEclipse and Xdebug.

Duplicate Sources

Duplicate Sources

You'll notice that when you add http://update.phpeclipse.net/update/stable/1.2.x to your Software Update list that you end up with two entries. That's because there's a HTTP 302 (temporary) redirect there, and for some reason Eclipse adds an entry for both URLs.  That's not at all confusing.

That's odd, there's an obtuse error message about unmet dependencies for CFUnit when we try and install PHPEclipse and Xdebug. Because they're obviously related. Uninstall CFUnit and it'll work.

CFUnit dependencies for PHPEclipse

CFUnit dependencies for PHPEclipse

Subversion

I'm going to use Subclipse here for no other reason than a few people said it's what they use.  I have no idea what the differences are (if any) between Subclipse and SubversiveSubversive says it "aims to provide SVN integration for Eclipse" and that in November 2007 it was started Incubation as a Technology Project.  To me, none of that implies anything good.  To install Subclipse add http://subclipse.tigris.org/update_1.4.x as a Site, install the Subclipse (required) package and restart. This sure is easy!

CSS, HTML, JavaScript

Does Eclipse include support for this out of the box? Maybe. Does Eclipse make it clear if they do? Of course not.  And the answer is no, support for this is not included.

It appears that the Web Tools Platform (WTP) Project will provide support for this.  WTP "includes source and graphical editors for a variety of languages, wizards and built-in applications to simplify development, and tools and APIs to support deploying, running, and testing apps."  There isn't much detail about what is included in a variety of languages.  Eclipse projects seem to be big on only providing a summary of what's included in a package. And if you think it's important to have more details, well then fuck you, go read the changelog.

Let's download WTP.

WTP - Stable Builds

WTP - Stable Builds

What the hell is this? Oh, whew, there's a legend.

WTP - Legend

WTP - Legend

OK, that's not comforting. Why would I want to download a stable build of anything that has 40 Access Rule Violations, 816 compilation warnings and 968 Access Rule Warnings?  Here's the quintessential example of a project that's run by developers. Just because that information is available, DOESN'T MEAN YOU SHOULD DISPLAY IT. Odds are since this is a stable build that those warnings and errors aren't a big deal.  If that's the case, don't show them right on the main page.

Let's skip the zip file anyways, and use the Update Manager.

This update site provides the features of the Eclipse Web Tools Platform (WTP).

If you are just getting started with Eclipse or Eclipse Web Tools, you may want to first install from the Ganymede update site, as it would have everything you need to get started.

This Web Tools Platform update site does assume you have all the pre-reqs installed.

Beyond the basic Web Tools Platform, this site offers the SDK version of Web Tools and also the XSL Incubating Component.

To use this update site in your existing installation of Eclipse, add the following URL as a remote update site in your update manager, if it does not already have it.

http://download.eclipse.org/webtools/updates/

Vague, obtuse documentation? I'm sensing a trend.

If you are just getting started with Eclipse or Eclipse Web Tools, you may want to first install from the Ganymede update site, as it would have everything you need to get started.

Install what from the Ganymede update site? Eclipse Web Tools, abbreviated as WTP? Or Ganymede? Don't forget, Ganymede is the latest release of Eclipse, 3.4.x.  What does "it" have to get me started?

This Web Tools Platform update site does assume you have all the pre-reqs installed.

You know what they say when you assume. Maybe I've got the pre-reqs installed, where can I find a list? Seriously, I'd love to know.

OK, let's pretend that we have the mythical pre-requisites installed, and add http://download.eclipse.org/webtools/updates/ to our Software Update sites.

Here is the list of available software before adding the WTP source:

Sources - Before Adding WTP Site

Sources - Before Adding WTP Site

Here is the list of available software after adding the WTP source:

Sources - After Adding WTP Site

Sources - After Adding WTP Site

Can you spot the diffence? Me either. If I drill down to Ganymede > Web and Java EE Development section I see something called Web Developer Tools, but the version number doesn't match anything on the Web Tools Platform (WTP) download page.  I've got an idea, let's take a look at the XML used by the pseudo-repository.

OK, there's a description: "The update site contains the features of the of Eclipse Web Tools Project (WTP)". Good, that helps. Huh, I can see that the Web Developer Tools package in the Software Update utility has a meaningful version of 3.0.2.v200808250510-7A-8f8QqVJLTFUkFahb1QIq2z0t8, and inside the XML ther's something with a category name of Web Tools Platform (WTP) 3.0.2 that also has a version of 3.0.2.v200808250510-7A-8f8QqVJLTFUkFahb1QIq2z0t8!  Let's view the Properties for the Web Developer Tools package through the Software Update tool.  The description is "Web Developer Tools minimum installation".  So, what is it, Web Tools Platform, or Web Developer Tools?

It's listed in the WTP site.xml, so it must be WTP.  That's odd though, 3.0.3 is the latest release of WTP, and I've got Software Update configured to "Show only the latest versions of available software" so why don't I see version 3.0.3?

Oh wait, even though we've added a source, we still need to enable it.

Because obviously the act of proactively adding a source doesn't imply that I want to see any updates from said source.  From the Software Update tool click Mange Sites and check the box next to the webtools URL.

Enable WTP Site

Enable WTP Site

Check off a few of the WTP items and click Install. It doesn't seem to matter which you check, because Eclipse will decide what needs to be installed anyways. But hey, thanks for giving me the illusion of choice.

Once it's done you'll have to restart Eclipse. Or do you? Even the WTP folks don't know (scroll to the very bottom), and they wrote the software!

Apply or Restart

Apply or Restart

The End

This is as far as we're going to get today.  The installation is such an incredibly complicated mess that I don't have the energy to test it out.  Hell, I barely have the energy to proof read this post.


© 2007-2010, Corey Gilmore | Posts RSS Feed | Comments RSS Feed | Contact

 

The views expressed on these pages are mine alone and not those of any past or present employer. All information presented on this site was obtained lawfully and not through disclosure under the terms of an NDA.