org.apache.fop.cli

## Class Main

- java.lang.Object
- - org.apache.fop.cli.Main

-     public final class Main
      extends Object

  Main command-line class for Apache FOP.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Main.SystemWrapper` Wrapper to support dependency injection.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `checkDependencies()`
    `static URL[]` | `getJARList()`
    `static void` | `main(String[] args)` The main routine for the command line interface
    `static void` | `startFOP(String[] args)`
    `static void` | `startFOP(String[] args, Main.SystemWrapper systemWrapper)` Executes FOP with the given arguments.
    `static void` | `startFOPWithDynamicClasspath(String[] args)` Dynamically builds a ClassLoader and executes FOP.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getJARList

          public static URL[] getJARList()
                                  throws MalformedURLException

      Returns:
        the list of URLs to all libraries.
      Throws:
        `MalformedURLException` - In case there is a problem converting java.io.File instances to URLs.

    - #### checkDependencies

          public static boolean checkDependencies()

      Returns:
        true if FOP's dependecies are available in the current ClassLoader setup.

    - #### startFOPWithDynamicClasspath

          public static void startFOPWithDynamicClasspath(String[] args)

      Dynamically builds a ClassLoader and executes FOP.
      Parameters:
        `args` - command-line arguments

    - #### startFOP

          public static void startFOP(String[] args)

    - #### startFOP

          public static void startFOP(String[] args,
                                      Main.SystemWrapper systemWrapper)

      Executes FOP with the given arguments. If no argument is provided, returns its version number as well as a short usage statement; if '-v' is provided, returns its version number alone; if '-h' is provided, returns its short help message.
      Parameters:
        `args` - command-line arguments
        `systemWrapper` - Object on which exit() is to be called.

    - #### main

          public static void main(String[] args)

      The main routine for the command line interface
      Parameters:
        `args` - the command line parameters

Copyright © 2025 Apache Software Foundation. All rights reserved.