first_page

Getting Eclipse for My Way

This summarizes the conceptually simple but actually tedious and complex task of customizing Eclipse WTP (Web Tools Project) on Ubuntu. The idea of the needle in a haystack is easy visualize but actually finding the needle is another matter. So what follows is a clutch of carefully wrapped needles:

  • Set up the Java environment from Sun Microsystems on Ubuntu, following official documentation. Failing to do this may cause you to unpack and run eclipse against the default Java environment and you may erroneously conclude (like me) that eclipse ‘runs slow’ on a virtual machine. Very ignorant. So pay close attention (Bryan) to the “Selecting the default Java version” section of the documentation such that these commands have meaning to you: sudo update-java-alternatives -s java-1.5.0-sun and sudo gedit /etc/jvm (move /usr/lib/jvm/java-1.5.0-sun to the top of the list).
  • Download eclipse WTP from the home page and unpack to your directory of choice.
  • Set up a menu item in GNOME with the mysterious Alacarté Menu Editor from the elusive Travis Watkins. Enter Alt+F1 for Main Menu > Accessories > Alacarte Menu Editor.
  • Open Eclipse and close the freaking Welcome tab. For formal tutorial purposes, you can open it again with the Help > Welcome menu command.
  • Setup PHPEclipse by using a New Remote Site… with URL http://phpeclipse.sourceforge.net/update/releases. A more detailed process is documented at plog4u.org.
  • Setup SQL Explorer by using a New Remote Site… with URL http://eclipsesql.sourceforge.net/. This is done knowing that the Eclipse Web Tools Project ships with Database Explorer.
  • Setup ActionScript Development Tool by using a New Remote Site… with URL http://aseclipseplugin.sourceforge.net/updates/.
  • Click the Make Default button for Window > Preferences > General > Perspectives > Available Perspectives: PHP.
  • Verify that the New text file line delimiter is set to Other: Unix under General > Workspace.
  • Under Window > Preferences > General >** Appearance > Color and Fonts** begin the nightmare of setting font sizes to your liking. The Microsoft Visual Studio team got this configuration feature right.
  • Select Show line numbers under Window > Preferences > General >** Editors > Text Editors**.
  • Verify that the T****ext file encoding is set to ISO-8859-1 under General > Workspace. This is done because Linux was not originally designed for UTF-8 and many of the file management tools (like sed) expect to not see UTF-8 by default. You do have the option to explicitly set/verify XML files for UTF-8.
  • Set Localhost: to your hostname under **Window > Preferences > **PHPeclipse Web Development > Project Defaults.
  • Set DocumentRoot**:** to the apache Web dev’ root under **Window > Preferences > **PHPeclipse Web Development > Project Defaults. This will separate PHP Project files from Eclipse Workspace configuration files. This is entirely a matter of style and perception of convenience.
  • I’m not quite sure what to document about Window > Preferences > PHPeclipse Web Development > PHP External Tools yet. All that can be written now, is that XAMPP is running under Eclipse.
  • Check Insert Spaces for tab under Window > Preferences > PHPeclipse Web Development > PHP > PHP Editor Settings: Typing. Again, a matter of style.
  • Install a whole bunch of JDBC drivers under Window > Preferences >** SQL Explorer > JDBC Drivers**. Refer to “Configuring Database Access in Eclipse 3.0 with SQLExplorer” by Deepak Vohra for more details.
  • Check each relevant entry under Window > Preferences > Web and XML to verify that spaces are being inserted instead of tabs (taste, taste, taste), XML formats are UTF-8 and that aggressive UNIX line delimiting is enforced.
  • Use the Window > Customize Perspective command to make sure PHP and other Perspective buttons show up for your one-click convenience (like switching from a Java Perspective to PHP or CVS Perspective). This is also the place edit toolbars and menu items.
  • When you are all done, use the File > Import…** > General > Existing Projects into Workspace** command to load preexisting PHP projects.

rasx()