1. Download the Java JAR (https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.1.0-SNAPSHOT/openapi-generator-cli-4.1.0-20190727.141928-68.jar)
2. Rename the JAR as "openapi-generator-cli.jar"
3. Run the following command to generate a Java API client for the Petstore API (https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml):
Mac/Linux:
> java -jar openapi-generator-cli.jar generate -g java -i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -o /var/tmp/java11/ --additional-properties library=native
Windows:
> java -jar openapi-generator-cli.jar generate -g java -i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -o C:\tmp\java11 --additional-properties library=native
Thanks Benjamin (https://github.com/bbdouglas) from Yelp (http://yelp.com/) for contributing the enhancement (https://github.com/OpenAPITools/openapi-generator/pull/3434).