Batch Build

NetPhantom provides a command line interface to the build system in order to use it in conjunction with external Make systems such as Ant. This is typically used when several applications are modules of a larger application. The larger application could consist of just a configuration "umbrella" of which applications to include. From such configuration, the resulting final application would require to compile the module applications first, followed by the "umbrella" application.

Using Batch Build or Compile Distribution, this can be accomplished, with the final result as a Jar file.


Batch building requires the Java Development Kit (JDK), not the Runtime Environment (JRE), as the Java compiler is part of the JDK. The JDK version can be 1.6 or better. If you are creating applications targeting a NetPhantom Server running Java 7, use JDK 1.7 or better.

Performing a Batch Build

The batch building uses a Java command line interface without a GUI that can easily be integrated with build tools such as Ant. Basically the parameters to the batch build are the applications to build.

The syntax is as follows:

  java -classpath NetPhantomServer.jar;NetRexxR.jar
    [-IgnoreUnresolved] [-NetPhantom5] project-directories
or use the batch file provided:
  CompileDistribution.bat [-IgnoreUnresolved] [-NetPhantom5] project-directories
The option -IgnoreUnresolved is used to create a Jar file even if there are remaining errors that could be potentially resolved for the application in a NetPhantom Server environment, e.g. Objects that cannot be loaded. Only use this option if you cannot work-around this problem by e.g. changing the classpath to include additional Jars or directories.

The option -NetPhantom5 is used to Compile a distribution for NetPhantom 5.

The project-directories is a list of project directories, e.g. "C:\Project with space\Module1" N:\Umbrella\Final. To specify a directory containing spaces in the path, surround the entire path with quotes.

In the NetPhantom installation directory a convenience CompileDistribution.bat file is provided that takes the project directories as parameters.

Return Codes

The possible return codes from the Batch Building are:

  • 0 = OK,
  • 1 = Severe error,
  • 2 = At least one error occurred when compiling a distribution,
  • 9 = Syntax error, e.g. no application directory specified.