Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading