Home > Mobile >  Options for command java: Is it called --add-modules (plural) or --add-module (singular)?
Options for command java: Is it called --add-modules (plural) or --add-module (singular)?

Time:09-13

Why is Jetty using the following peculiar java command in order to specify the modules which are to be installed?

java -jar $JETTY_HOME/start.jar --add-module=server,http,deploy

According to the java command specification it must be called --add-modules but not --add-module. I don't get it. Is it an option Jetty invented for its own purposes?

CodePudding user response:

According to the documentation it looks like they're both valid and acceptable for Jetty. It's unclear whether the --add-module form accepts more than one argument, but if in doubt I'd use --add-modules even to add a single module.

By the way, that's an option you pass to jetty, not to java. They can call it whatever they want.

As per the java manual, the command line to run a jar is

java [options] -jar jarfile [args ...]`

where [options]

Specifies command-line options separated by spaces. See Overview of Java Options for a description of available options."

while [args ...]

are passed as arguments to the main class

  • Related