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

Installation/Custom/Apache Ant

Ant

Contents

Apache Ant

Apache Ant is a Java-based build tool used by Openbravo to automate most of its development / deployment tasks.

For the specific versions supported and the currently recommended version check the System Requirements.

Working ant installation to it can be called from command line and uses the Java version installed / configured in the earlier step.

Required configuration

The variable ANT_OPTS needs to be configured to specify at least 1GB of Java Heap for running ant tasks.

Bulbgraph.png   Starting from PR19Q1, if using Java 11 and ant version used is lower than 1.10.6, the following parameter should be added to ANT_OPTS:
ANT_OPTS="-Djdk.util.jar.enableMultiRelease=force"

See [1] for more details.

Example install using Ubuntu 18.04 LTS

Install ant package

apt-get install ant

Create config file to specify memory:

sudo su -  
echo 'export ANT_OPTS="-Xmx1024M"' > /etc/profile.d/ant.sh

Example install of Apache Ant on Microsoft Windows

  1. Download and extract Apache Ant onto your system (for instance, C:\Apache-Ant).
  2. Add ANT_HOME environment variable:
    1. Right-click on My Computer.
    2. Select Properties. The System Properties window appears.
    3. Select the Advanced tab.
    4. Click on the Environment Variables button.
    5. Click the New button.
    6. In the Variable name field, type ANT_HOME.
    7. In the Variable value field, type the path of the Ant directory. This is usually C:\Apache-Ant.
    8. Click OK.
    9. Select the PATH environment variable.
    10. In the Variable value field type %ANT_HOME%\bin.
  3. Equally add the ANT_OPTS environment variable:
    1. Click the New button.
    2. In the Variable name field, type ANT_OPTS.
    3. In the Variable value field, type -Xmx1024M.

How to test the installation

In Command Prompt (cmd.exe) run all of the following commands and verify their output.

  1. echo %ANT_OPTS%
  2. ant -version

Both command should work without errors and the output should be the ant options you just defined above and the ant version you have installed.

If any of those previous steps did not work go back and fix it now. As it will otherwise lead to problem later on.

Retrieved from "http://wiki.openbravo.com/wiki/Installation/Custom/Apache_Ant"

This page has been accessed 56,082 times. This page was last modified on 13 December 2018, at 17:35. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.