Getting Started - Developers

Pre-Requisites

  • For the ofbiz-framework trunk and ofbiz-plugins trunk the minimum requirement you need installed is Java 17 JDK (the full JDK, not just the JRE). Make sure to set the $JAVA_HOME environment variable.
  • For release 18.12, the minimum requirement is Java 11 JDK.
  • Apache OFBiz can be downloaded and run on both Unix based and Windows based systems.
  • On Windows, a PowerShell version >= 7.1.3 is required (needed by the Gradle wrapper initialization script).
  • On Windows, do not install OFBiz in a directory whose path contains spaces.

NOTE: If you are running an older release or branch then please refer to our Wiki for details

Download

There are two ways to download the OFBiz source code

1. Using a Download Mirror

Download your required version from one of our download mirrors and extract the zip file

2. Checkout the Source Code

Checkout the source code from the repository

Anyone can checkout or browse the source code in the OFBiz GitHub repositories.

To checkout the source code, simply use the following commands (if you are using a GUI client, configure it appropriately).

We have split OFBiz into ofbiz-framework and ofbiz-plugins, so if you want to use the ofbiz-plugins you need to checkout both trunks.

  • ofbiz-framework trunk : $ git clone https://github.com/apache/ofbiz-framework.git ofbiz-framework
  • ofbiz-plugins trunk : $ git clone https://github.com/apache/ofbiz-plugins.git plugins
  • branch release18.12 (stable): $ git clone https://github.com/apache/ofbiz-framework.git ofbiz-framework
  • If you don't want to use the HEAD version (Git default, with last bug fixes), you can update the tags before.
    You can refer to the site download page for the stable version to use.
    Note that you need to add "release"in the name before, like in "release18.12.10", eg with releaseVersionNumber as a var:
    git fetch --all --tags
    $ git checkout releaseVersionNumber
  • branch release18.12 (stable): $ git clone https://github.com/apache/ofbiz-plugins.git ofbiz-plugins
  • $ git checkout releaseVersionNumber

Initialize Gradle Wrapper

The Gradle wrapper is no longer bundled with the ofbiz-framework trunk source. Before running any gradlew command you must download the wrapper from the OFBiz top-level directory.

Run the following command for Unix-like OS

./gradle/init-gradle-wrapper.sh

Run the following command for MS Windows

init-gradle-wrapper

NOTE: On Windows, if you encounter an error such as "Powershell is not recognized as an internal or external command, operable program or batch file", follow the advice at https://s.apache.org/vdcv8. If you run into problems, check the execution policy of PowerShell (see https://s.apache.org/urnju). By setting the execution policy to "unrestricted", you will be prompted to run the script once you run the init-gradle-wrapper command.

NOTE: This step is only required once per checkout. Existing release branches (such as release18.12) ship the Gradle wrapper inside the repository and do not require this step.

Build and Run

Once you have downloaded the source code and (for trunk) initialized the Gradle wrapper, it will need to be built.

Building the Trunk

To build the trunk, navigate to the framework-trunk directory and;

Run the following command for Unix-like OS

./gradlew cleanAll loadAll

Run the following command for MS Windows

gradlew cleanAll loadAll

Building Release 18.12

To build 18.12 release, navigate to the OFBiz or framework-trunk directory and;

Run the following command for Unix-like OS

./gradlew cleanAll loadDefault

Run the following command for MS Windows

gradlew cleanAll loadDefault

Starting and Running the ofbiz-framework trunk or 18.12

To start OFBiz running locally, navigate to the trunk directory and;

Run the following command for Unix-like OS

./gradlew ofbiz

Run the following command for MS Windows

gradlew ofbiz

To log into OFBiz, navigate with your browser to

https://localhost:8443/accounting

and login with username "admin" and password "ofbiz"

Stopping OFBiz

To stop OFBiz running locally, open a command line terminal window and navigate to the OFBiz directory and;

Run the following command for Unix-like OS

./gradlew 'ofbiz --shutdown'

Run the following command for MS Windows

gradlew ofbiz --shutdown

NOTE: That quotes are needed for the Unix based command. For further details and a full list of all available OFBiz Gradle commands, please take a look at the main README file.
If you are an user migrating from a version which uses Ant you might be interested by: From Ant to Gradle

Browse Repository

You can browse the repository using any of the following links.

Our ofbiz-framework trunk and ofbiz-plugins trunk are also available on GitHub at the links below:

Development Tutorial

To help you getting started we have put together a beginners OFBiz development tutorial to get familiar with with OFBiz.

It covers the fundamentals of the OFBiz application development process. The goal of this tutorial is to acquaint a developer with best practices, coding conventions. the control flow and things that the developer needs to know in order to modify OFBiz

Documentation and Help

We have a range of technical documenentation and help for developers. Please see the links below.

OFBiz API Reference

After consulting the documentation you still have questions,please feel free to post questions on our development mailing list.

Demo

Try out our OFBiz demo - OFBiz Demos