There is 2 ways to download and install Eclipse IDE in your Linux box, you can do it automatically from the comfort of your software center or the Linux terminal with few commands or manually downloading and installing Eclipse IDE from the Eclipse project website.

+

There are several ways to download and install Eclipse IDE to your Linux box, you can do it automatically from the comfort of your software center or using the Linux terminal with few commands or manually downloading and installing Eclipse IDE from the Eclipse project website or other alternative download sites.

=== Method 1: From a Linux repository ===

=== Method 1: From a Linux repository ===

−

'''NOTE:''' This method is the most recommended because you will have the benefits of automate all the installation process and get automatic security and bug fixes updates when the software is installed from the repositories.

+

'''NOTE:''' This method is the most recommended because you will have the benefits of automate all the installation process and get automatic security patches and bug fixes updates when the software is installed from the repositories.

−

==== Method 1: Terminal ====

+

==== Option 1: Terminal ====

*Open your terminal and type

*Open your terminal and type

<tt> sudo apt-get install eclipse </tt>

<tt> sudo apt-get install eclipse </tt>

*Wait until installation process finish

*Wait until installation process finish

−

*If everything whent fine Eclipse IDE should be available in the software menu

+

*If everything went fine Eclipse IDE should be available in the software menu

−

+

==== Option 2: Software center ====

−

==== Method 2: Software center ====

+

*Open the software center that comes with your distribution

*Open the software center that comes with your distribution

*Type in the search box "Eclipse IDE"

*Type in the search box "Eclipse IDE"

−

*Select Eclipse IDEe in the search result list

+

*Select "Eclipse IDE" in the search result list

*Click on the "install" button

*Click on the "install" button

*Wait until installation processes finish

*Wait until installation processes finish

−

*If everything whent fine Eclipse IDE should be available in the software menu

+

*If everything went fine Eclipse IDE should be available in the software menu

−

+

=== Method 2: From a downloaded copy ===

=== Method 2: From a downloaded copy ===

+

+

'''NOTE:''' For manual download and installation you got to have JAVA runtime previously installed or Eclipse IDE will not run

+

+

To install java runtime on your Linux box open a terminal and type folloging command and wait until the installation finish:

+

+

<tt>sudo apt-get install sun-java6</tt>

+

+

You can also install java from your software center just type "openjdk java 6" and install the package.

+

+

To get a copy of Eclipse IDE follow these steps:

*Go to: [http://www.eclipse.org/downloads/ Eclipse download page]

*Go to: [http://www.eclipse.org/downloads/ Eclipse download page]

*Download "Eclipse Classic" 32 or 64 bits according to your current OS version

*Download "Eclipse Classic" 32 or 64 bits according to your current OS version

−

*Unpack the downloaded file on any location comfortable for you, ex: Downloads folder or Desktop

+

*Unpack the downloaded file on any location that you want, ex: Downloads folder or Desktop folder

*Open the eclipse folder an find an executable file called "eclipse"

*Open the eclipse folder an find an executable file called "eclipse"

*Do a right click on the file then -> properties -> permissions and check "Allow executing file as a program"

*Do a right click on the file then -> properties -> permissions and check "Allow executing file as a program"

Line 44:

Line 51:

eclipse</tt>

eclipse</tt>

−

'''NOTE:''' For manual download and installation you got to have JAVA runtime previously installed or Eclipse IDE will not run, when you install eclipse from terminal all the packages and dependencies are automatically downloaded and installed.

+

'''NOTE:''' At the [http://www.eclipse.org/downloads/ Eclipse download page] you can see many versions of Eclipse IDE, all of them are basically the same Eclipse with a bunch of extensions pre-installed to do specific task by default Eclipse IDE comes with all the tools needed to develop JAVA projects but you can install more extensions to develop in other languages, click in the link [http://www.eclipse.org/downloads/compare.php Compare Packages] to see a complete char of all the extensions included on each Eclipse Package build, you can try one of these pre-build packages specifically created for PHP development some of them are official releases from the Eclipse website and others are independent projects:

'''NOTE:''' At the [http://www.eclipse.org/downloads/ Eclipse download page] you can see many versions of Eclipse IDE, all of them are basically the same Eclipse with a bunch of extensions pre-installed to do specific task by default Eclipse IDE comes with all the tools needed to develop JAVA projects but you can install more extensions to develop in other languages, click in the link [http://www.eclipse.org/downloads/compare.php Compare Packages] to see a complete char of all the extensions included on each Eclipse Package build, ex: you can download "Eclipse Classic" and manually install some extensions to make it works just like the version called "Eclipse IDE for JavaScript Web Developers" which contains several common extensions needed to develop web applications.

+

{{chunk:Configuring Eclipse IDE for PHP development - Understanding the interface}}

+

== Understanding the folder structure ==

−

== Understanding the Eclipse IDE interface ==

+

When you execute Eclipse for the first time, it ask you to create a "workspace" the workspace is a folder where Eclipse IDE will store 2 things all your custom configurations and all or some of your projects.

−

Eclipse IDE is not just a editor it is a platform and can be used to many thing, that is why it implement a very flexible philosophy to denominate and describe the way it display and organize the information, the most relevant parts of eclipse interface are:

+

All your projects will be separated by folders inside the workspace folder like this

+

<tt>

+

/home/youruser/workspace/project-a

+

/home/youruser/workspace/project-b

+

/home/youruser/workspace/joomla_component

+

/home/youruser/workspace/joomla-test-site

+

</tt>

−

*The tool bar: Is at the top of the window just like any other common application

+

You can have more than one workspace, each of them will contain it own custom configurations and will not affect the information of other workspaces, for example you can have a workspace located at "/home/youruser/java-workspace/" dedicated to contain Java projects and an a separated workspace like this "/home/youruser/php-workspace/" dedicated to PHP development.

−

*The tool bar with buttons: Is right under neat the toolbar it contains a bunch of buttons most of them change according the current context, view or perspective, you can drag and drop that some of it buttons to arrange them the way you want

+

−

*The views: They are sections that divide the windows content and display different kind of information, you can arrange the views in almost any possible way, ex: columns, rows, complex combinations of columns and rows and so forth

+

−

*The perspectives: The perspectives are just a setup of views arranged in certain configuration and normally sharing a relationship between them

+

−

Is important to understand how this perspective philosophy works, for example The "PHP perspective" is used to edit PHP code so is coherent to display views related to the PHP code edition, views to manage the project files and views to navigate trough the code, the following is a typical "PHP perspective":

+

As you can see your workspace folder could be on any valid folder location, for the purposes of PHP development and our convenience we can set our workspace folder in the same location were our web server store it web files for example "/home/youruser/lamp/public_html/" this way Eclipse IDE and our web server will use the same location for our web files.

−

*Docked at the left with several tabs are the "PHP explorer" view and the "Type Hierarchy explorer" view

+

Is important to note that you have the additional option to place your project files outside the workspace locations if you wish, this way Eclipse gives you an additional flexibility in certain cases, for example, lets say we got a workspace located at "/home/youruser/workspace/" witch contains several random projects, but our server store it files in a different location at "/home/youruser/lamp/public_html/" of course we want to put our PHP project there so we can edit the files and serve the pages at the same time, so all you need to do is to create a folder like this "/home/youruser/lamp/public_html/my-joomla-project", then create a new PHP project and manually specify the path of our new project.

−

*In the middle is a wide view which is the "editor area", there will be as many tabs as many files you are editing

+

−

*Docked at the right with several tabs are the "Search" view and the "outline" view, they will assist you to find chuck of code or navigate trough the parts, variables and object of your current file under edition.

+

−

*Docked at the bottom are with several tabs are the "Problems" view,"Task" view, "Console" view and "Progress" view there you will see things like unsolved problems like syntax errors, uncompleted TODO tasks, and see the progress of build or update operations

+

−

In the other hand the "Debug Perspective" share some views with the "PHP perspective" but have a different arrangement of views and got more different views related to the code debugging operations such as:

+

You may ask what is the difference of project that are inside and outside the workspace folder, the only noticeable difference is at the moment of creating new projects, when you create a project inside the workspace Eclipse IDE will automatically create a folder for that project with the same name of the project itself, in the other hand if the project is outside the workspace location you can set a random name for the project and then you got to set the path of the project manually regardless of the destination folder name.

−

*Debug view: Display the call stack of the current breakpoint

+

A final note about the behavior of creating new project is that Eclipse IDE will not let you link an external project that is actually inside your current workspace location (Duh!), also you can manually create any folder inside your Eclise IDE workspace location but that does not means Eclipse will recognize such folders as a project at all, when you create the new project from Eclipse IDE that shares the name of an existing folder that already exist in your workspace Eclipse will automatically link all it content to your new project.

−

*servers view: Display a list of the configured server to debug with

+

−

*Variables view: This view shows a tree that is basically is a complete dump of all the variables and object of the current session at the current breakpoint

+

−

*Breakpoints view: Display a list of all the breakpoints set all over your project, you can double click on one of the item of that list to jump in that exact line of code

+

−

*Expressions views: There you can create expressions on the fly to evaluate them without the need of do code modifications

+

−

You can switch betweend perspectives selecting them at "Tool bar --> window --> Open perspective" or you can click in the perspective buttons located at the far right of the "The tool bar with buttons"

+

When you create a new workspace Eclipse IDE will automatically create a hidden folder called ".metadata" it will contain all our custom global configurations about the editors, perspectives and views, all this configurations will be inherited by any new project by default, but if you wish you can override part of the global configurations with custom configurations values specifics for each project.

−

If you don't feel happy with any of this perspective configurations and how their views are arranged, you can create your very own perspectives and add as much views as you want and arrange them the way that makes you feel good, you just got to:

+

When you create a new project Eclipse IDE will create these hidden files and folders inside your new project folder:

−

*Modify the current perspective (any it doesn't matter)

+

<tt>

−

*Add thew views you want and remove the others you don't

+

.project

−

*Arrange the views the way you like and make you feel comfortable

+

.buildpath

−

*Go to "Tool bar --> window --> Save perspective as" and set a name for your custom perspective, ex: "pimp-My-IDE" and save it, you can also overwrite an existing view name

+

.settings

+

</tt>

+

This files and folders contain information about your custom project configurations and building information that will let Eclipse show tree views of dependencies and classes among many other things.

−

So far you should be able to know how to play with Eclipse IDE and understand it interface philosophy, if you want to see a video demonstration about Eclipse IDE to get a preview and taste some of it powers check this out [[Webinar: Using Eclipse for Joomla! Development]]

+

{{Chunk:Configuring Eclipse IDE for PHP development - Configuration}}

+

[[Category:Development]]

−

== Configuration ==

+

== Fine tuning ==

+

=== Increase RAM memory usage ===

−

=== Installing more extensions ===

+

By default Eclipse got some configuration to limit the amount of RAM memory, this configurations works fine for most users but if you 2GB of ram or more you should consider set this values to improve Eclipse IDE performance.

−

For your Eclipse IDE you will need to install more extension for PHP development and other tools to help you in your project development journey, follow this steps and indications:

+

First you got to locate the "eclipse.ini" file that contains some few Eclipse IDE configurations.

−

*On Eclipse go to: "Toolbar --> help --> install new software"

+

*If you downloaded Eclipse IDE manually from internet the "eclipse.ini" file is just inside the unpacked folder

−

*You are now on the "Install" window, click the drop-down list "Work with" and set it to "--All Available Sites--"

+

*If you installed Eclipse via terminal or software center the location of the file is "/etc/eclipse.ini"

−

*In the search box type the following keywords and select all the results in the list below:

+

*In some Linux versions the file can be found at "/usr/share/eclipse/eclipse.ini"

−

**subversive

+

−

**Remote Development Support

+

−

**php

+

−

**xml editors

+

−

**xsl editors

+

−

**javascript

+

−

**Remote System Explorer

+

−

**Eclipse Web Developer Tools

+

−

**Web Page Editor

+

−

*Press "Next>" and follow the installation wizard and restart Eclipse if needed

+

−

Those are all the extension to install for now, they should be enough to work with local and remote PHP and Joomla development projects, nonetheless you can experiment and tray all the extensions you like.

+

'''NOTE:''' If you found a config file at "/etc/eclipse.ini" then don't edit the file at "/usr/share/eclipse/eclipse.ini"

*Drag the view from the tab and drop it next to the "PHP explorer" view

+

−

Now you can explore local and remote PHP project, how to configure this tools will be explained in [[Setting_up_your_workstation_for_PHP_development | this]] series of articles, but for now leave it for the future.

+

<tt>

−

+

-startup

−

=== Configuring the editors ===

+

plugins/org.eclipse.equinox.launcher_1.2.0.dist.jar

−

+

--launcher.library

−

These are some of the configuration you can do to your editors to improve the user experience:

+

plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.100.dist

−

+

-showsplash

−

==== Display white spaces ====

+

org.eclipse.platform

−

+

--launcher.XXMaxPermSize

−

Some people like to see the white spaces represented in the editor to do so:

Code folding is a nice feature of some editor, it allow you to fold the code in certain data structures like functions, classes and other structures such as conditionals, we are going to fold all the possible except classes content to be able to check and study PHP files quickly

Eclipse provides some nice utilities to automatically clean the source code of some extra garbage such as cleaning empty lines, deleting unnecessary trials spaces, formatting to the code and more. To activate some of this features follow these instructions:

Theses instructions should work fine on any Debian based distribution such as Debian, Ubuntu, LinuxMint, Xubuntu, Kbuntu and others.

Installation

There are several ways to download and install Eclipse IDE to your Linux box, you can do it automatically from the comfort of your software center or using the Linux terminal with few commands or manually downloading and installing Eclipse IDE from the Eclipse project website or other alternative download sites.

Method 1: From a Linux repository

NOTE: This method is the most recommended because you will have the benefits of automate all the installation process and get automatic security patches and bug fixes updates when the software is installed from the repositories.

Option 1: Terminal

Open your terminal and type

sudo apt-get install eclipse

Wait until installation process finish

If everything went fine Eclipse IDE should be available in the software menu

Option 2: Software center

Open the software center that comes with your distribution

Type in the search box "Eclipse IDE"

Select "Eclipse IDE" in the search result list

Click on the "install" button

Wait until installation processes finish

If everything went fine Eclipse IDE should be available in the software menu

Method 2: From a downloaded copy

NOTE: For manual download and installation you got to have JAVA runtime previously installed or Eclipse IDE will not run

To install java runtime on your Linux box open a terminal and type folloging command and wait until the installation finish:

sudo apt-get install sun-java6

You can also install java from your software center just type "openjdk java 6" and install the package.

Download "Eclipse Classic" 32 or 64 bits according to your current OS version

Unpack the downloaded file on any location that you want, ex: Downloads folder or Desktop folder

Open the eclipse folder an find an executable file called "eclipse"

Do a right click on the file then -> properties -> permissions and check "Allow executing file as a program"

To execute Eclipse IDE, you can do a double click on the executable file or run it from terminal, ex:

cd ~/Downloads/eclipse/
eclipse

NOTE: At the Eclipse download page you can see many versions of Eclipse IDE, all of them are basically the same Eclipse with a bunch of extensions pre-installed to do specific task by default Eclipse IDE comes with all the tools needed to develop JAVA projects but you can install more extensions to develop in other languages, click in the link Compare Packages to see a complete char of all the extensions included on each Eclipse Package build, you can try one of these pre-build packages specifically created for PHP development some of them are official releases from the Eclipse website and others are independent projects:

Understanding the interface

Eclipse IDE is not just a editor it is a platform and can be used to many thing, that is why it implement a very flexible philosophy to denominate and describe the way it display and organize the information, the most relevant parts of eclipse interface are:

The tool bar: Is at the top of the window just like any other common application

The tool bar with buttons: Is right under neat the toolbar it contains a bunch of buttons most of them change according the current context, view or perspective, you can drag and drop that some of it buttons to arrange them the way you want

The views: They are sections that divide the windows content and display different kind of information, you can arrange the views in almost any possible way, ex: columns, rows, complex combinations of columns and rows and so forth

The perspectives: The perspectives are just a setup of views arranged in certain configuration and normally sharing a relationship between them

Is important to understand how this perspective philosophy works, for example The "PHP perspective" is used to edit PHP code so is coherent to display views related to the PHP code edition, views to manage the project files and views to navigate trough the code, the following is a typical "PHP perspective":

Docked at the left with several tabs are the "PHP explorer" view and the "Type Hierarchy explorer" view

In the middle is a wide view which is the "editor area", there will be as many tabs as many files you are editing

Docked at the right with several tabs are the "Search" view and the "outline" view, they will assist you to find chuck of code or navigate trough the parts, variables and object of your current file under edition.

Docked at the bottom are with several tabs are the "Problems" view,"Task" view, "Console" view and "Progress" view there you will see things like unsolved problems like syntax errors, uncompleted TODO tasks, and see the progress of build or update operations

In the other hand the "Debug Perspective" share some views with the "PHP perspective" but have a different arrangement of views and got more different views related to the code debugging operations such as:

Debug view: Display the call stack of the current breakpoint

servers view: Display a list of the configured server to debug with

Variables view: This view shows a tree that is basically is a complete dump of all the variables and object of the current session at the current breakpoint

Breakpoints view: Display a list of all the breakpoints set all over your project, you can double click on one of the item of that list to jump in that exact line of code

Expressions views: There you can create expressions on the fly to evaluate them without the need of do code modifications

You can switch betweend perspectives selecting them at "Tool bar --> window --> Open perspective" or you can click in the perspective buttons located at the far right of the "The tool bar with buttons"

If you don't feel happy with any of this perspective configurations and how their views are arranged, you can create your very own perspectives and add as much views as you want and arrange them the way that makes you feel good, you just got to:

Modify the current perspective (any it doesn't matter)

Add thew views you want and remove the others you don't

Arrange the views the way you like and make you feel comfortable

Go to "Tool bar --> window --> Save perspective as" and set a name for your custom perspective, ex: "pimp-My-IDE" and save it, you can also overwrite an existing view name

So far you should be able to know how to play with Eclipse IDE and understand it interface philosophy, if you want to see a video demonstration about Eclipse IDE to get a preview and taste some of it powers check this out Webinar: Using Eclipse for Joomla! Development

Understanding the folder structure

When you execute Eclipse for the first time, it ask you to create a "workspace" the workspace is a folder where Eclipse IDE will store 2 things all your custom configurations and all or some of your projects.

All your projects will be separated by folders inside the workspace folder like this

You can have more than one workspace, each of them will contain it own custom configurations and will not affect the information of other workspaces, for example you can have a workspace located at "/home/youruser/java-workspace/" dedicated to contain Java projects and an a separated workspace like this "/home/youruser/php-workspace/" dedicated to PHP development.

As you can see your workspace folder could be on any valid folder location, for the purposes of PHP development and our convenience we can set our workspace folder in the same location were our web server store it web files for example "/home/youruser/lamp/public_html/" this way Eclipse IDE and our web server will use the same location for our web files.

Is important to note that you have the additional option to place your project files outside the workspace locations if you wish, this way Eclipse gives you an additional flexibility in certain cases, for example, lets say we got a workspace located at "/home/youruser/workspace/" witch contains several random projects, but our server store it files in a different location at "/home/youruser/lamp/public_html/" of course we want to put our PHP project there so we can edit the files and serve the pages at the same time, so all you need to do is to create a folder like this "/home/youruser/lamp/public_html/my-joomla-project", then create a new PHP project and manually specify the path of our new project.

You may ask what is the difference of project that are inside and outside the workspace folder, the only noticeable difference is at the moment of creating new projects, when you create a project inside the workspace Eclipse IDE will automatically create a folder for that project with the same name of the project itself, in the other hand if the project is outside the workspace location you can set a random name for the project and then you got to set the path of the project manually regardless of the destination folder name.

A final note about the behavior of creating new project is that Eclipse IDE will not let you link an external project that is actually inside your current workspace location (Duh!), also you can manually create any folder inside your Eclise IDE workspace location but that does not means Eclipse will recognize such folders as a project at all, when you create the new project from Eclipse IDE that shares the name of an existing folder that already exist in your workspace Eclipse will automatically link all it content to your new project.

When you create a new workspace Eclipse IDE will automatically create a hidden folder called ".metadata" it will contain all our custom global configurations about the editors, perspectives and views, all this configurations will be inherited by any new project by default, but if you wish you can override part of the global configurations with custom configurations values specifics for each project.

When you create a new project Eclipse IDE will create these hidden files and folders inside your new project folder:

.project
.buildpath
.settings

This files and folders contain information about your custom project configurations and building information that will let Eclipse show tree views of dependencies and classes among many other things.

Configuration

Installing more extensions

For your Eclipse IDE you will need to install more extension for PHP development and other tools to help you in your project development journey, follow this steps and indications:

On Eclipse go to: "Toolbar --> help --> install new software"

You are now on the "Install" window, click the drop-down list "Work with" and set it to "--All Available Sites--"

In the list expand the nodes and find the following packages to install:

Note: You can also use the search box, but for some reason (maybe a bug) Eclipse IDE hangs for few seconds on every search.

goto "Web, XML, and Java EE Development" and select

PHP Development Tools (PDT) SDK Feature

JavaScript Development Tools

Eclipse Web Developer Tools

goto "General Purpose Tools" and select

Remote System Explorer End-User Runtime

Press "Next>" and follow the installation wizard and restart Eclipse if needed

On Eclipse go to: "Toolbar --> help --> install new software"

Press the "Add" button and add this new repository, name it "xtext plugin"

Code folding

Code folding is a nice feature of some editor, it allow you to fold the code in certain data structures like functions, classes and other structures such as classes, conditionals and iterators, we are going to fold all the possible except classes content to be able to check and study PHP files quickly

code cleaning

Eclipse provides some nice utilities to automatically clean the source code of some extra garbage such as cleaning empty lines, deleting unnecessary trials spaces, formatting to the code and more. To activate some of this features follow these instructions:

If you are done doing configurations press "OK" to save and close the preferences window

Fine tuning

Increase RAM memory usage

By default Eclipse got some configuration to limit the amount of RAM memory, this configurations works fine for most users but if you 2GB of ram or more you should consider set this values to improve Eclipse IDE performance.

First you got to locate the "eclipse.ini" file that contains some few Eclipse IDE configurations.

If you downloaded Eclipse IDE manually from internet the "eclipse.ini" file is just inside the unpacked folder

If you installed Eclipse via terminal or software center the location of the file is "/etc/eclipse.ini"

In some Linux versions the file can be found at "/usr/share/eclipse/eclipse.ini"

NOTE: If you found a config file at "/etc/eclipse.ini" then don't edit the file at "/usr/share/eclipse/eclipse.ini"