Grid Library Example

Last published : Jul 27, 2026
The following example grid-library.xml is for a mixed Java/C++ application that runs on Windows, and both gcc and gcc34 for Linux:
<?xml version="1.0" encoding="UTF-8"?>
<grid-library>
    <grid-library-name>MyLib</grid-library-name>
    <grid-library-version>1.0.0.1</grid-library-version>
<!-- Example of how to use both gcc83 libraries -->
    <lib-path os="linux64" compiler="gcc83">
        <pathelement>lib/gcc83</pathelement>
    </lib-path>
<!-- All three C++ bridges are included here -->
    <dependency>
        <grid-library-name>cppbridge-vc16</grid-library-name>
    </dependency>

    <dependency>
        <grid-library-name>cppbridge-gcc83</grid-library-name>
    </dependency>
<!-- Specifies JVM options in a JRE Grid Library -->
    <arguments>
        <property>
            <name>-Xdebug</name>
        </property>
        <property>
            <name>-Xmx512m</name>
        </property>
        <property>
            <name>-Dfoo</name>
            <value>bar</value>
        </property>
    </arguments>
<!-- Example of linking to another of my Grid Libraries-->
    <dependency>
        <grid-library-name>MyCalculator</grid-library-name>
    </dependency>
    <hooks-path>
        <pathelement>hooks</pathelement>
    </hooks-path>
<!-- Example of multiple jar paths -->
    <jar-path>
        <pathelement>jars</pathelement>
        <pathelement>morejars</pathelement>
    </jar-path>
<!-- Example of a lib path with absolute dir -->
    <lib-path os="win64">
        <pathelement>lib\win64</pathelement>
    </lib-path>
<!-- Example of OS-dependent env vars, using a property sub -->
    <environment-variables os="win64">
      <property >
            <name>MY_WIN_VAR</name>
            <value>$WinVar$</value>
        </property>
    </environment-variables>
    <environment-variables os="linux64" compiler="gcc83">
    <property >
            <name>MY_GCC_VAR</name>
            <value>$LinuxDriverDir$</value>
        </property>
    </environment-variables>
    <java-system-properties>
        <property>
            <name>foo</name>
            <value>bar</value>
        </property>
    </java-system-properties>
</grid-library>
Related information