Openbravo Environment Setup in Eclipse

I have been using Openbravo for more than an year now and what I noticed is that its a big jungle to enter. You have to learn all about Ubuntu (the preferred platform), then setting up the stack viz, Java, Postgres, PgAdmin(GUI of postgres), Tomcat, Ant, Openbravo, Pentaho(BI tool), etc etc…A good play ground to dig and play, but you can be rest assured your suits wont go unscathed more often than not. This is where you need a good dig tool and IDE’s are just for that task.  Though my personal favorite IDE is Netbeans, Eclipse is the preferred environment for Openbravo, so I decided to go through that route..:)

I went through  a lot of hardships, but nevertheless the result was satisfying and i wanted to bring you that. There is a Eclipse installation Manual (http://wiki.openbravo.com/wiki/ERP/2.50/Developers_Guide/Development_Environment/Setting_up_Development_Environment_with_Eclipse_IDE), but I can assure you that with that link, its bound to take you at least 2 days to complete the installation. So am I going to provide something better than what the Openbravo guys did? Na Na..:) I am just going to shrink and stay up to the point, so that you can have it up and running in a single day.

Importing Openbravo in Eclipse can be subdivided into the following sections.
1. Eclipse setup and configuration
2. Openbravo import and setup
3. Tomcat server and setup

1. Eclipse Setup and configuration:
We can download eclipse from, http://www.eclipse.org/downloads/packages/release/galileo/sr2. Make sure you download the EE version so that most packages are already available. The following are the architectural elements that are needed for Openbravo to run.
1. Subclipse
2. Mercurial
3. Openarchitectureware (for template changes in core)
So once  you have downloaded and installed eclipse (its just a click and choose process), you will have the IDE that resembles something like this..:)

Now we have installed eclipse successfully. First hurdle crossed. Next to add the above listed elements(plugins), go to Help -> Install New Software. Here click the Add Button and provide the following link in the Location Field. http://subclipse.tigris.org/update_1.4.x. In the Name field Provide subclipse or anything for your reference. Then give Next, next and choose finish to install it. Once this is complete eclipse will be restarted. Next lets install Mercurial. For this Use the same Install New Software under Help and use the Add Button to add the Following URL in the Location Field, http://subclipse.tigris.org/update_1.4.x .
Once you provide that, you will get a window similar to that.

If you are installing in ubuntu you can uncheck the windows binaries. Then click next and give finish. The same is to be followed for installing Openarchitectureware, using the following URL, http://www.openarchitectureware.org/updatesite/milestone/site.xml. Once Eclipse is installed, our next step is to import Openbravo.

2. Openbravo import and setup
Go to File -> New -> Other and in the  window that pops out choose Mercurial and the sub option as Clone from Existing Repository. Provide the URL from which you want to clone. If there is no repository, use File -> Import and choose the source folder of Openbravo. Then right click the Project folder and choose Properties. In the source tab add the following folders.

1. src folders of your modules and openbravo src folder
2. src-test folders of your modules and openbravo src-test folder
3. src-gen folder
4. src-core->src
5. src-wad->src
6. src-wad->build->javasqlc->src
7. src-trl->src
8. src-trl->build->javasqlc->src

 

 

 

Add the following libraries in the library tab.

1. lib->runtime
2. lib->build
3. src-db->database->lib

Refresh the project. Next step is to compile this application.

To add ant commands go to Run-> External Tools -> External Tools Configurations. Then double click, “Ant Build” and then you can find a screen as follows.

So you can add new tasks using the small new button and add as many tasks as you want. You just have to give path as provided in Main Tab. And tick the appropriate task in the Targets Tab. Openbravo is configured..:)

3. Tomcat server and setup
To add tomcat 6.-0 server, go to File -> New -> Other and choose tomcat 6.0 as the server and map the corresponding tomcat folder. And then add openbravo to it and give finish.

The eclipse would now appear as follows.

Note Openbravo attached to tomcat server. Now you can right click the project and choose Run ->  “run on server” to deploy Openbravo. Done. Openbravo will be up and running..:)

Happy working..:)

Advertisements

About Shankar Balachandran
Technical Manager, Openbravo operations, Kailao Consulting Private Limited

19 Responses to Openbravo Environment Setup in Eclipse

  1. Cesar says:

    Hi Shankar Balachandran

    i followed your tutorial, i think that is very good, but i have a problem in the steep 2, in the part when you say:
    Then right click the Project folder and choose Properties. In the source tab remove the project files related to util.

    please, ca you be more specific in this part.
    Which folders or files do i have to delete?
    Which process do i follow?

    if you can show me some pictures about the process, that’s good.

    Thank you and excuse me my English I’m from Mexico.

    • Shankar Balachandran says:

      Hi Cesar,
      Thanks for your Comment. I have updated the post. Revert back if there are any more doubts.

  2. Pingback: Database Development Perspective in Eclipse for Openbravo,Postgres « Fugo Consulting

  3. khafa says:

    Hi,

    This is my first time developing with Openbravo and I tried to follow your article but it looks like I am missing something. In the official documentation from the Openbravo team, they say that you run “ant setup”, then the setup graphical tool and “ant install.source” and only then can you import the projects in Eclipse and continue with the setup. In you article did you assume that all that is already done in the repository we are cloning with mercurialeclipse? I am asking this because I tried to clone a local repository (without running the above source settings) but then I do not have the build folder and try to install the source with ant from eclipse fails with a lot of errors. Could you tell me if everything needed is in this page or do we need to accomplish some steps before starting with your setup procedure?

    Thank you in advance

    • Shankar Balachandran says:

      Hi,
      The document is presented with the assumption that, Openbravo is already setup in the machine and then subsequently imported into Eclipse. So after you clone, you can run ant setup and then setup the properties, compile and then follow these steps. get back if you have any more issues in this regards.

      • khafa says:

        Hi Shankar,

        Cool. Thanks for the quick reply. I will try it once at home and let you know the outcome.
        Thanks again

  4. zohaib says:

    Hi,

    I am not able to custom install openbravo 3 with following software.

    Do you have any video tutorial about installation like many on YOU TUBE.

    1.win32 oracle database 11gR2

    2.apache-ant-1.8.1 or apache-ant-1.7.1

    3.jdk-6u26-windows-i586 – Java 6

    4.jre-6u26-windows-i586

    5.Windows XP or Windows 7

    6.Openbravo-3.0MP0 or Openbravo-3.0MP1

    Thanks,
    Zohaib

    • Shankar Balachandran says:

      Hi Zohaib,
      Where are you getting stuck up while installing? May be that would help. I don’t remember seeing any installation video in you tube for the same config.

  5. zohaib says:

    Hi Shankar,

    I want to install openbravo 3.

    I am not able to do ant diagnostic successfully (getting errors).

    I have laptop with 3GB RAM and Windows 7

    Following is the environment details

    1.Oracle Database 11gR2 Win32

    2.apache-ant-1.7.1 or apache-ant-1.7.1

    3.jdk-6u26-windows-i586 – Java 6 update 26

    4.jre-6u26-windows-i586 – Java 6 update 26

    5.Windows XP or Windows 7

    6.Openbravo-3.0MP0 or Openbravo-3.0MP1 => not getting install

    7.OpenbravoERP-2.50MP22 => working

    8. Apache Tomcat 6 (apache-tomcat-6.0.32 or apache-tomcat-6.0.20)

    Enviromental Variables

    CATALINA_BASE
    E:\Program Files\Apache Software Foundation\Tomcat 6.0

    CATALINA_HOME
    E\Program Files\Apache Software Foundation\Tomcat 6.0

    CATALINA_TMDIR
    E:\Program Files\Apache Software Foundation\Tomcat 6.0\temp

    ANT_HOME
    E:\ant

    Path – JAVA_HOME
    E:\Program Files\Java\jdk1.6.0_26\bin
    E:\Program Files\Java\jre6\bin
    ANT_HOME
    E:\ant

    PATH
    E:\ant\bin;

    ANT_OPTS
    -Xmx1024M -XX:MaxPermSize=128M

    JAVA_OPTS
    -Xmx1024M -XX:MaxPermSize=128M
    -XX:MaxPermSize=128M

    CATALINA_OPTS
    -Xmx1024M -XX:MaxPermSize=128M

    OB forum url

    http://forge.openbravo.com/projects/openbravoerp/forum/question-about-openbravo-3-installation-t7026048.html-sid=35481b2079bf2f3b7db270cd3814dd56

    ERROR message as follows

    E:\eworkspace\openbravo>ant diagnostic
    Buildfile: E:\eworkspace\openbravo\build.xml

    diagnostic:

    clean:
    [mkdir] Created dir: E:\eworkspace\openbravo\src-util\diagnostic\WebContent\
    WEB-INF\lib
    [mkdir] Created dir: E:\eworkspace\openbravo\src-util\diagnostic\build\class
    es
    [copy] Copying 1 file to E:\eworkspace\openbravo\src-util\diagnostic\config

    [copy] Copying 3 files to E:\eworkspace\openbravo\src-util\diagnostic\WebCo
    ntent\WEB-INF

    build:
    [copy] Copying 63 files to E:\eworkspace\openbravo\src-util\diagnostic\WebC
    ontent\WEB-INF\lib
    [javac] E:\eworkspace\openbravo\src-util\diagnostic\build-create.xml:34: war
    ning: ‘includeantruntime’ was not set, defaulting to build.sysclasspath=last; se
    t to false for repeatable builds
    [javac] Compiling 15 source files to E:\eworkspace\openbravo\src-util\diagno
    stic\build\classes
    [javac] E:\eworkspace\openbravo\src-util\diagnostic\src\org\openbravo\check\
    Check.java:26: package javax.servlet does not exist
    [javac] import javax.servlet.ServletException;
    [javac] ^
    [javac] E:\eworkspace\openbravo\src-util\diagnostic\src\org\openbravo\check\
    Check.java:27: package javax.servlet.http does not exist
    [javac] import javax.servlet.http.HttpServlet;
    [javac] ^
    [javac] E:\eworkspace\openbravo\src-util\diagnostic\src\org\openbravo\check\
    Check.java:28: package javax.servlet.http does not exist
    [javac] import javax.servlet.http.HttpServletRequest;
    [javac] ^
    [javac] E:\eworkspace\openbravo\src-util\diagnostic\src\org\openbravo\check\
    Check.java:29: package javax.servlet.http does not exist
    [javac] import javax.servlet.http.HttpServletResponse;
    [javac] ^
    [javac] E:\eworkspace\openbravo\src-util\diagnostic\src\org\openbravo\check\
    Check.java:34: cannot find symbol
    [javac] symbol: class HttpServlet
    [javac] public class Check extends HttpServlet {
    [javac] ^
    [javac] E:\eworkspace\openbravo\src-util\diagnostic\src\org\openbravo\check\
    Check.java:38: cannot find symbol
    [javac] symbol : class HttpServletRequest
    [javac] location: class org.openbravo.check.Check
    [javac] protected void doPost(HttpServletRequest req, HttpServletResponse
    resp) throws ServletException,
    [javac] ^
    [javac] E:\eworkspace\openbravo\src-util\diagnostic\src\org\openbravo\check\
    Check.java:38: cannot find symbol
    [javac] symbol : class HttpServletResponse
    [javac] location: class org.openbravo.check.Check
    [javac] protected void doPost(HttpServletRequest req, HttpServletResponse
    resp) throws ServletException,
    [javac] ^
    [javac] E:\eworkspace\openbravo\src-util\diagnostic\src\org\openbravo\check\
    Check.java:38: cannot find symbol
    [javac] symbol : class ServletException
    [javac] location: class org.openbravo.check.Check
    [javac] protected void doPost(HttpServletRequest req, HttpServletResponse
    resp) throws ServletException,
    [javac]
    ^
    [javac] E:\eworkspace\openbravo\src-util\diagnostic\src\org\openbravo\check\
    Check.java:77: cannot find symbol
    [javac] symbol : class HttpServletRequest
    [javac] location: class org.openbravo.check.Check
    [javac] protected void doGet(HttpServletRequest req, HttpServletResponse r
    esp) throws ServletException,
    [javac] ^
    [javac] E:\eworkspace\openbravo\src-util\diagnostic\src\org\openbravo\check\
    Check.java:77: cannot find symbol
    [javac] symbol : class HttpServletResponse
    [javac] location: class org.openbravo.check.Check
    [javac] protected void doGet(HttpServletRequest req, HttpServletResponse r
    esp) throws ServletException,
    [javac] ^
    [javac] E:\eworkspace\openbravo\src-util\diagnostic\src\org\openbravo\check\
    Check.java:77: cannot find symbol
    [javac] symbol : class ServletException
    [javac] location: class org.openbravo.check.Check
    [javac] protected void doGet(HttpServletRequest req, HttpServletResponse r
    esp) throws ServletException,
    [javac]
    ^
    [javac] E:\eworkspace\openbravo\src-util\diagnostic\src\org\openbravo\check\
    Check.java:37: method does not override or implement a method from a supertype
    [javac] @Override
    [javac] ^
    [javac] E:\eworkspace\openbravo\src-util\diagnostic\src\org\openbravo\check\
    Check.java:76: method does not override or implement a method from a supertype
    [javac] @Override
    [javac] ^
    [javac] 13 errors

    BUILD FAILED
    E:\eworkspace\openbravo\build.xml:946: The following error occurred while execut
    ing this line:
    E:\eworkspace\openbravo\src-util\diagnostic\build-create.xml:34: Compile failed;
    see the compiler error output for details.

    Total time: 3 seconds
    E:\eworkspace\openbravo>\

  6. zohaib82 says:

    Anyone able to install ob 3 on windows

    please take video & share with community

    I am finding it difficult to install

    thanks
    j

  7. michael says:

    is it possible to set up the enviroment on a windows platform instead of using linux??

  8. Bjørn Høj Jakobsen says:

    First is there any none religious reason to use Eclipse instead of Netbeans.

    It would be very helpful if somebody made a setup description for Netbeans like this one:
    http://wiki.openbravo.com/wiki/ERP_2.50:Developers_Guide/Installation_and_setup_of_Netbeans_IDE#Importing_Openbravo_ERP_projects.

    In the 2.5 version you had to run the “ant install.source” after cloning the main project.

    Is that also the case for the latest version?.

  9. bhar47 says:

    url for subclipse and mercurial is same….. In eclipse its showing duplicate location while installing new software.

    • Shankar Balachandran says:

      Thanks for the information buddy. Will check it and update the post accordingly..:)

  10. Avinash says:

    Hi,
    We are installing custom installation of openbravo. Our ant install.source completes successfully. but when we try to access openbravo on web browser(httpp://localhost:8080/openbravo) only a blenk page appears.

    please help

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

%d bloggers like this: