liveBook · Manning

System property

As explained in Quarkus in Action

A system property is a named configuration value supplied to a Java process and accessible through its runtime environment.

A system property is a named value supplied to a Java process, commonly with the -Dname=value syntax. In Quarkus, it provides a deployment-time override when changing application.properties would require rebuilding the compiled artifact. section 3.2.3

Quarkus resolves configuration values in this order:

  • JVM system properties take precedence over environment variables and application.properties. section 3.2.3
  • Environment variables override application.properties when no system property supplies the value. section 3.2.3
  • Environment-variable names capitalize the property and replace dots with underscores; for example, my.greeting becomes MY_GREETING. section 3.2.3
  • Values in application.properties are not automatically exposed through System.getProperties() or System.getenv(); application code reads them through the MicroProfile Config API. section 3.3.1

Override a greeting in Dev mode

With greeting configured as Hello configuration in application.properties, run GREETING="Environment variable value" quarkus dev -Dgreeting="System property value". A request to /hello returns System property value. Removing -Dgreeting makes the endpoint return Environment variable value instead. section 3.2.3

Listing 3.4 Config override with system property
$ GREETING="Environment variable value" quarkus dev \
-Dgreeting="System property value"

Inspect the complete command that combines an environment variable with a higher-priority -D system property. section 3.2.3

How Quarkus in Action covers it

How deep it goes
Explains priority, naming conversion, commands, and API boundaries, but does not detail JVM property internals.
Examples
Demonstrates greeting overrides through Quarkus Dev mode and displays system properties in the Dev UI configuration panel.
What it assumes
Assumes a Quarkus application with application.properties and teaches configuration-source precedence from the basic override workflow.
What you can do after
Operate/configure Quarkus applications by overriding values with -D properties and predicting which configuration source wins.
How it connects
Connects system properties with environment variables, application.properties, Dev mode, and the MicroProfile Config API.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.