Command-line Options

Options to configure Native Image are provided in the following categories:

Depending on the GraalVM version, the options to the native-image builder may differ.

Native Image options can also be categorized as hosted or runtime options.

For more information describing how to define and use these options, read the com.oracle.svm.core.option package documentation.

Build Options

Run native-image --help for help on build options.

Extra Build Options

Run native-image --help-extra for help on additional options.

List of Useful Options

There are some expert level options that a user may find useful or needed. For example, the option to dump graphs of the native-image builder, or to print various statistics during the build process.

Build Output and Build Report

Native Image provides an informative build output including various statistics during the build process. The build output in a JSON-based, machine-readable format can be requested using the -H:BuildOutputJSONFile option, and later processed by a monitoring tool. The JSON files validate against the JSON schema defined in build-output-schema-v0.9.2.json. A comprehensive report with additional information can be requested using the -H:+BuildReport option.

Graph Dumping

Native Image re-used the options for graph dumping, logging, counters, and everything else from the GraalVM debug environment. These GraalVM options can be used both as hosted options (if you want to dump graphs of the native-image builder), and as runtime options (if you want to dump graphs during dynamic compilation at runtime).

The Graal compiler options that work as expected include Dump, DumpOnError, Log, MethodFilter, and the options to specify file names and ports for the dump handlers. For example: