Getting Started with Eclipse Part 2
Okay, so it took me WAY longer than a week to get this up, I apologize. However, as promised, here is the second half of Peter Coles' walkthrough of Eclipse. This portion focuses on the actual installation and configuration of Eclipse. If you don’t know what Eclipse is, or want to see why Peter loves it, check out the part 1 post. Everyone else, enjoy!
We’ll start by scooting over to http://download.eclipse.org/tools/pdt/downloads/index.php to pick up a copy of the latest stable release (currently 1.0.3). This wraps up both base Eclipse and the PHP Development Tools. Once downloaded, unzip it and pop the eclipse folder somewhere appropriate. In Windows, I put it in the “Program Files” folder and created a shortcut to the executable file in my quick launch bar. On the Mac I put it in the applications folder and dragged the executable to the dock. In Linux…well if you’re using Linux then I doubt that you need my help on this. Step 2
Launch Eclipse and specify where you would like to store your workspace. This is where all your files and settings will be put. Step 3
Click on the button to the right to go to the workbench. You can explore the snazzy icons later. Step 4
On the main menu go to Help > Software Updates > Find and Install. Select Search for new features to install and click Next. Click the New Remote Site… button and create a site called “Aptana” with URL “http://update.aptana.com/update/studio/”. Click on Finish and it will do a search for what’s available and should find Aptana. Tick the box next to it and then click Next. Accept the license agreement, click Next and then Finish. Go make a cup of tea or take some other refreshment, this will take a while. Once the download is complete you’ll probably be asked to install unsigned items part. Be brave, click Install All. Once completed you be asked to agree to configure your firewall to allow Aptana through (it likes to update you on new features). There’s no need to restart Eclipse yet. You have now installed the community version of Aptana Studio, but not its PHP tools (which we don’t want — they interfere with the better PDT tools) into Eclipse. You can learn more about Aptana Studio at http://www.aptana.com/studio. Step 5
Now we’re going to add a couple of optional plug-ins from an independent source: Andrei Loskutov. Two of his plug-ins are of particular interest: FileSync and AnyEdit. FileSync allows a link to be created between a file in a project and an external location. For Kuroi this is useful to maintain the link between the development fileset and the test environment files, but I can imagine many other possible uses depending upon your workflow. AnyEdit is the plug-in that I am using to automatically replace tabs with spaces and strip whitespace from the end of lines. The install process is similar to Step 4. Help > Software Updates > Find and Install; select Search for new features to install and click on Next. Click the New Remote Site… button and create a site called “Andrei Loskutov” with URL “http://andrei.gmxhome.de/eclipse/". If the Aptana box is still checked, uncheck it and click Finish. Expand the list of features until you can see all five. Select those you want (FileSync and AnyEdit Tools recommended). Click on Next, accept the licenses, Next again, Finish and then Install All. Still no need to restart Eclipse. Step 6
Finally we’re going to install Subversive. This is the most complex installation, and it’s only marginally more complex than those we did in the previous two steps as we will need to interrogate two remote sites and exclude some options. Let’s first go to Help > Software Updates > Find and Install; select Search for new features to install and click on Next. Click the New Remote Site… button and create a site called “Subversive” with URL “http://download.eclipse.org/technology/subversive/0.7/update-site/” (and while you’re there, uncheck Andrei). Repeat the process yet again to create another remote site called “Subversive SVN Connections” with URL “http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/” and hit finish. I recommend ticking the Automatically select mirrors box on the popup that appears, then OK. Check the first box and you’ll probably get a message about the “Mylyn Project.” Drilling down will show you where it’s coming from and allow you to uncheck this option. Clicking on the Connections box may result in errors (for the Mac I had to remove Win32 specific options — seems reasonable). Then carry on as for the previous options, but this time opt to restart Eclipse at the end of the process. Don’t worry if it starts up once and then restarts itself a second time, it won’t do this normally. Step 7
Close down the welcome screen — I’ll leave you to decide whether to install the further updates from Aptana at this time. You’ll probably want to get rid of that Aptana Welcome page too for the moment. Step 8
Let’s get in the mood for PHP. in the menu bar, go to Window > Open Perspective > PHP. Step 9
Now we’ll set a few configs. First find the preferences menu. In Windows it’s at the bottom of the window menu. On a Mac it’s near the top of the Eclipse menu. Wherever it is, open it and go to PHP > Formatter and change the tabs to 2 spaces. Then, still in the preferences popup, back up to General > Editors > AnyEdit Tools and under the Auto Convert tab, check convert tabs <-> spaces. You want to uncheck the warning immediately below too. Then Click on OK. Step 10
To create a new project, click on the top left icon and select New PHP Project. Step 11
To set up a subversive link to a repository we’ll first open up a new view: Window > Show View > Other… > SVN > SVN repositories. Click on the icon with the green plus, and the rest should be obvious (if you are familiar with SVN already).
If it feels like an abrupt ending, I apologize. Peter's walkthrough ends here, however things continue to get more interesting. The entire concept of an Eclipse project deserves a walkthrough in its own right, along with workspaces and perspectives (these Google search results will get you started, though). I strongly recommend you hit up the Eclipse Wiki and the official documentation for more information.
comments powered by Disqus