setup Eclipse IDE

This tutorial will share how to use Eclipse IDE to develop openbravo, In another word: How to import openbravo to Eclipse IDE. once imported, you can debug and run Openbravo from Eclipse directly. Beside development purpose, debugging openbravo also very effective approach to determine defect inside openbravo, especially when you face undesired behavior.

we have 3 steps to setup Eclipse IDE for Openbravo:

  1. install eclipse
  2. import openbravo project
  3. setup apache tomcat on eclipse

1. install eclipse

you can download Eclipse here. after downloading, extract to a folder, we will call <eclipse forder> for now and later. as usual, I will install in home folder /home/<your user name>/eclipse.

run your eclipse by double clicks on eclipse file, its an executable file. for the first time running eclipse, you will asked where to put eclipse workspace. you can create a folder named workspace inside <eclipse folder>: /home/<your username>/eclipse/workspace.

From openbravo tutorial

click ok. wait a moment, eclipse will look like this

From openbravo tutorial

click workbench on right top corner, your eclipse will look like this:

From openbravo tutorial

2. import openbravo project

your eclipse ready, now importing openbravo. click file | import

From openbravo tutorial

select general | existing projects into workspace

From openbravo tutorial

browse your openbravo source folder

From openbravo tutorial

eclipse will recognise project name as “openbravo”, click ok.

From openbravo tutorial

now import your second project. do as you did to import openbravo to import OpenbravoTrl on folder <openbravo source folder>/src-trl

From openbravo tutorial

click ok, then continue to import 3rd project OpenbravoWAD on folder <openbravo source folder>/src-wad

From openbravo tutorial

click ok, then continue to import 4th project OpenbravoCore on folder <openbravo source folder>/src-core

From openbravo tutorial

now we will add a build path to include openbravo libarary to eclipse. right klik on openbravo project, select properties | build path

From openbravo tutorial

click tab libraries, click button add JARs

From openbravo tutorial

select openbravo | lib | build, select all available JARs.

From openbravo tutorial

click ok. click ok one more. eclipse will rebuild work space, now no error appear. your eclipse work space will look like this

From openbravo tutorial

3. setup apache tomcat on eclipse

now open “debug” prespective

From openbravo tutorial

open server tab, klik “no server are available. click this link to create a new server”

From openbravo tutorial

specify tomcat installation directory, set to <tomcat folder>. specify JRE to use, select jdk-8. you may refer to “how to install openbravo” blog post as a reference of what is <tomcat folder> and how to install JDK 8.

From openbravo tutorial

click finish. now double click apache tomcat server that just created, and maximise Tomcat 8 window to make you easier during configure Tomcat 8. on “server options” section, uncheck “module auto reload by default”. on “time out” section, set start in 600 second, and stop in 300 second. once done, open sub-tab “modules”.

From openbravo tutorial

add web module, select openbravo.

From openbravo tutorial

click web module “openbravo” you just created, click edit, uncheck “auto reloading enabled”.

From openbravo tutorial

your tomcat now ready. save tomcat configuration. close tomcat configuration window. now start your tomcat in debug mode

From openbravo tutorial

wait for a moment, its about 2 or 3 minutes. tomcat log will show like this to sign you if tomcat started and ready:

From openbravo tutorial

now using browser, go to localhost:8080/openbravo

From openbravo tutorial

now you ready to debug openbravo using eclipse. just give a break point in the desired line code, openbravo will break on those line code during execution. for example, I will add a break point at CalculateSalaryFormula.java line code 24. when you click button calculate salary formula on salary payment window, eclipse will stop at line 24 of this java class.

From openbravo tutorial

you may press F6 to go to next line code

From openbravo tutorial

now you are ready to debug openbravo, get deep insight what really happen inside. very effective to determinde deffect, come from bad code, code logic, or broken data.

happy coding with openbravo.

Advertisements

2 thoughts on “setup Eclipse IDE

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s