.. _option-handling-java: ==================== Java Option Handling ==================== In |java| generally two different ways of getting command line parameters from the caller of a program exist. On the one hand, the usual list of arguments is passed to the main function. On the other hand, the virtual machine provides a property system. These properties can be set using ``-D`` flags. We recommend the use of these flags, as they are available even if you do not have the main method under your control. Unfortunately, no standard library exists to support handling these properties. Hence, some manual work is required, as e.g. shown in :download:`Runner.java ` in the example project: .. literalinclude:: example-projects/build-system-essentials-java/src/corlab/buildsystemessentials/Runner.java :language: java :start-after: mark-start::show-for-parsing :end-before: mark-end::show-for-parsing :linenos: