Native Image Hosted and Runtime Options

Along with all the options listed in the Native Image Build Options, we also distinguish between hosted and runtime options.

For developer documentation on how to define and use options, read the documentation of the package.

List of Useful Options

Graph Dumping

Native Image re-used the GraalVM options for graph dumping, logging, counters, and everything else in 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:

Software Bill of Materials (SBOM)

Oracle GraalVM Native Image can embed a Software Bill of Materials (SBOM) into a native executable by using an experimental option. The option takes the desired SBOM format as input, and the embedded SBOM can be passively obtained by using the Native Image Inspection Tool or by saving the SBOM alongside the native executable using the optional print flag. Currently, the CycloneDX format is supported. Users may embed a CycloneDX SBOM into a native executable by using the --enable-sbom option during compilation. The SBOM is stored in a compressed format (gzip) with the exported sbom symbol referencing its start address and the sbom_length symbol its size.

Debug Options

These options enable additional checks in the generated binary to help with debugging:

Control the Main Entry Points

Further Reading