Installing Eclipse on Windows

From PGVWiki
Jump to navigation Jump to search

There are many IDEs available for working with PHP files and of course you may use any tools that you like. However, I have found many advantages to using Eclipse for developing PhpGedView:

  • Integration with CVS and SVN. You don't have to switch back and forth between programs.
  • Open Source
  • PHP Syntax Highlighting and intellisense (i.e. code completion)
  • Built-in PHPDoc (i.e. get API documentation about functions and classes just by hovering over them)
  • HTML and JavaScript Syntax Highlighting and editing
  • Planned support for integrated debugging in the near future

This page will detail how to setup Eclipse for working on PhpGedView.

PHP Eclipse Plug-ins

Eclipse is an extensible IDE that allows you to install plugins to do different types of development. In order to develop PHP in the Eclipse IDE, you need to install a PHP Plugin for Eclipse.

There are two main PHP Plug-ins:

  • PHPEclipse - an open source project external to the Eclipse project. Has the benefit of being around longer.
  • Eclipse PHP IDE - an internal Eclipse project sponsored by IBM and Zend to produce a PHP IDE.

Both plugins are very good. I have found the debugger in PHPEclipse to be very slow when working with PhpGedView. The Eclipse PHP IDE debugger is still under development.

Getting Eclipse

You may obtain the latest Eclipse release from http://www.eclipse.org/downloads/

Eclipse comes as a ZIP file which can be extracted anywhere. However, I have discovered that you can run into path length problems (255 char max in Windows XP) if you unpack Eclipse in a deep directory structure. C:\Program Files\eclipse is a good place to put it.

You may want to spring for the all-in-one package provided by the PHP IDE project. It has everything you need to get started using PHP with Eclipse. http://download.eclipse.org/tools/php/downloads/index.php?release=I20060926-024

Installing the PHP Plugin

If you installed the all-in-one package then you don't need to do anything in this section and you are ready to start Eclipse.

  1. Download one of the plugins:
  2. Unpackage the downloaded file and copy the features and plugins folders to your Eclipse directory (C:\Program Files\eclipse)
  3. Start Eclipse and switch to the PHP Perspective
    1. You may need to close the Welcome Page if you have never used Eclipse before.
    2. Using the menus, navigate to: Window->Open Perspective->Other...
    3. Select PHP from the list of Perspectives
      • If you don't see PHP listed as one of the options, then you are probably missing some other required plugins. See the documentation for your selected plug-in to see what other plugins are required.

Installing the Subclipse Subversion Plugin

Eclipse includes built-in support for CVS. So if you plan to use the CVS code you are set.

But you probably want to use the latest development code from the Subversion (SVN) repository. In order to access Subversion from Eclipse, you will need to install the Subclipse plugin

The Subclipse plugin should be installed using Eclipse's online update manager. The Subclipse team has put together a good install guide here: http://subclipse.tigris.org/install.html

Checkout the Project from SVN

  1. First you should check that you have a good workspace location.
    1. From the File menu select the Switch Workspace option
    2. You should choose a workspace that is outside the user space (i.e. Documents and Settings) because IIS and the Windows ACL will have trouble accessing all of the include files and will give you lots of permissions errors.
    3. A good location would be something like C:\workspace or C:\phpgedview\workspace
  2. Open the SVN Repository Perspective
    1. From the Window menu select the Open Perspective menu item, then select the Other option
    2. The select perspective window appears. Choose the SVN Repository Exploring option from the list and hit OK
  3. Right click in the SVN Repository view and select the New -> Repository Location option.
    1. Set the repository URL to: https://phpgedview.svn.sourceforge.net/svnroot/phpgedview
  4. Checkout the files as a new PHP project
    1. Expand the https://phpgedview.svn.sourceforge.net/svnroot/phpgedview repository
    2. Expand the trunk element
    3. Right-click on the phpGedView folder and select "Checkout..."
    4. Select the option to Check out as a project configured using the new project wizard and click Finish
    5. Choose PHP as the project option
    6. Enter a name for your project and click finish