View source | Discuss this page | Page history | Printable version   

How to setup Eclipse IDE

Contents

Preparing development environment

First of all you need to install and configure different components of the Openbravo ERP environment as it's described in Custom Installation guide. In order to comply to development requirements some of those components have to be additionally adjusted according to Development Stack Setup.

Bulbgraph.png   Double check that you have read and followed the Development Stack Setup article

After completing all of the steps in the aforementioned guides, please make sure that:

Now check out Openbravo ERP source code from the repository.

Download source code

The source code can be checked out using any Mercurial client. There is no any restrictions on the read access so you wouldn't need any credentials to access the repository. The detailed procedure of the source code check out is described in Mercurial Manual for Openbravo Developers. As it's explained in the guide it's normally considered as a good practice to have a pristine clone and working one, so we would strongly encourage you to follow that 'rule'. It is also highly advisable to clone the repository into a destination directory which is outside of Eclipse workspace.

If you want to build the latest stable release:

$ hg clone https://code.openbravo.com/erp/devel/main openbravo
$ cd openbravo
$ hg up 3.0MP22.2

For Openbravo developers, you should work with the pi repository:

hg clone https://code.openbravo.com/erp/devel/pi
$ cd pi

Openbravo installation

The Openbravo ERP installation is performed in several steps.

Configure the properties

So, first of all you have to configure the Openbravo ERP by specifying some general properties, e.g. Tomcat installation directory, database connection details, etc. This can (and in fact must) be done via a special GUI application which has to be downloaded first. For that, go to the directory with the working clone of the repository and execute:

ant setup

The invocation of this ant target will download an executable file called setup-properties-[OS_NAME].[EXT] in config subdirectory.

Move into this subdirectory and launch the executable file to start the GUI configuration application. By going through the wizard pages provide all requested information and click Finish to apply the changes and close the application. As a result of these actions a new file Openbravo.properties, containing specified settings, will be created in config subdirectory.

Bulbgraph.png   While going through the setup wizard, DO NOT change the default context name which is openbravo. This guide assumes that it will be left this way.

More about the properties can be found at Openbravo.properties. Now the Openbravo ERP is ready to be installed.

Bulbgraph.png   You can run the setup properties file in text-mode using the mode argument, e.g. config $ ./setup-properties-linux.bin --mode text

Install from sources

In order to install the Openbravo ERP three main procedures have to be accomplished:

All this is done by invoking from the root of the working clone (XXX\opensource\openbravo\erp\devel\main\).

ant install.source

This process can take quite long time (up to 25 min) depending on hardware configuration. It's always a good idea to redirect the output of the task execution to a log file which then can be analyzed or sent to the support team in case of problems. After the task has completed the log should not contain any error or exception massages as well as it should have BUILD SUCCESSFUL message at the end of the file. (if you are under Linux use grep command to check whether the file contains any exceptions). After successful installation the next step can be taken - importing to Eclipse IDE.

Bulbgraph.png   You can save the install.source log using tee in Linux or mtee in Windows

Problems running install.source

If you find problems running install.source, check the Installation/Troubleshooting article

Import into Eclipse IDE

Launch Eclipse.

Bulbgraph.png   After Eclipse has started go to Project menu and disable Build Automatically option there.

Now 4 projects need to be imported in the workspace (by menu File=>Import and then General=>Existing Projects into Workspace). Here they are:

openbravo        XXX\opensource\openbravo\erp\devel\main\
OpenbravoCore    XXX\opensource\openbravo\erp\devel\main\src-core
OpenbravoTrl     XXX\opensource\openbravo\erp\devel\main\src-trl
OpenbravoWAD     XXX\opensource\openbravo\erp\devel\main\src-wad

Create the Tomcat Server

Then open Servers view and create a new instance of Tomcat server:


Tomcat.server.JPG


While going through the wizard select openbravo and add it to configured resources. Then click "Finish". The created instance should appear in the view. Double click on it to change its settings in the form depicted on the picture below:

Tomcat.server.2.JPG

Change VM arguments settings

 -Xms384M -Xmx512M -XX:MaxPermSize=256M 

After changing all, save your server configuration (press Ctrl+S).

Import Preferences

The next step is to set the standard preferences used in the development of Openbravo.

ImportPreferences1.jpg

ImportPreferences2.jpg

Once finished, select all the projects, refresh them, and rebuild them (right click on one or more projects and you will find the Refresh and the Rebuild options). You should get warnings, but not errors.

Launch from Eclipse

Now start the Tomcat server by right-clicking on the server instance in the Servers view and choosing Start option in the popup menu. Wait until the server is started (can take up to 2 minutes) and visit http://localhost:8080/openbravo/ in your internet browser. If everything was configured and installed properly you will get to the Openbravo ERP log in page. Use these credentials to log in:

both are case sensitive.

That's it, the installation is over and you're ready to start developing.

Bulbgraph.png   If your system has enough resources (memory/processor) then you can try enabling the Build Automatically option in the Project menu. Enabling it will give you direct feedback while developing.

Retrieved from "http://wiki.openbravo.com/wiki/How_to_setup_Eclipse_IDE"

This page has been accessed 30,167 times. This page was last modified on 13 February 2013, at 10:43. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.