Skip to content

Swagger Codegen Prerequisites

If you’re looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):

Terminal window
1
wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.65/swagger-codegen-cli-3.0.65.jar -O swagger-codegen-cli.jar
2
3
java -jar swagger-codegen-cli.jar --help

For Windows users, you will need to install wget or you can use Invoke-WebRequest in PowerShell (3.0+). For example:

Terminal window
1
Invoke-WebRequest -OutFile swagger-codegen-cli.jar https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.65/swagger-codegen-cli-3.0.65.jar

On a Mac, it’s even easier with brew:

Terminal window
1
brew install swagger-codegen

To build from source, you need the following installed and available in your $PATH:

OS X Users

Don’t forget to install Java 11.

Export JAVA_HOME in order to use the supported Java version:

Terminal window
1
export JAVA_HOME=`/usr/libexec/java_home -v 11`
2
export PATH=${JAVA_HOME}/bin:$PATH