Java quickstart
Generate a Java SDK by following the instructions on this page.
This page assumes that you have:
- An initialized
fernfolder. See Set up thefernfolder. - A GitHub repository for your SDK. See Project Structure.
Pass fern check
Run fern check to ensure that your API definition is valid. If there are any errors,
fix them before proceeding.
If you’re using an OpenAPI Specification, check out all of our supported extensions.
Add the SDK generator
Run the following command to add the Java SDK generator to generators.yml:
java-sdk is the name of the generators.yml group that configures your Java
SDK’s output location and other metadata. You can customize this group name to
differentiate between multiple SDKs across different languages (e.g.,
ruby-sdk, etc) in your organization.
This command adds the following group to generators.yml:
Generate the SDK
Run the following command to generate your SDK:
If you have multiple APIs, use the --api flag to specify the API you want to generate:
This creates a sdks folder in your current directory. The resulting folder structure looks like this: