Prerequisites
- JDK 17 or later
- An Apple Developer Program membership
- A long-lived Apple Maps authorization token — if you don’t have one yet, see Authorization
Add the dependency
Add the The artifact is published to Maven Central — no extra repository configuration required.
apple-maps-java artifact to your build file.Get an authorization token
Apple Maps Java requires a long-lived JWT issued from the Apple Developer portal. You’ll need to:
- Create a Maps Identifier in your Apple Developer account.
- Generate a private key associated with that identifier.
- Use the private key to sign a JWT with the required claims.
Set the APPLE_MAPS_TOKEN environment variable
Export your token as an environment variable before running your application.Alternatively, pass it as a JVM system property:
If your JWT was generated with a specific
origin claim, also export APPLE_MAPS_ORIGIN with the same origin value (for example https://api.example.com). The SDK sends this as the HTTP Origin header.Initialize the AppleMaps client
Read the token from the environment and construct an If you also need to pass an
AppleMaps instance.origin:What’s next
Now that you have a working geocode call, explore the rest of the SDK:Installation reference
Full installation options including snapshot builds.
Authorization
How to create and configure your Apple Maps token.
Geocoding guide
Geocode, reverse geocode, and understand results.
Search & Autocomplete
Find businesses and POIs with typeahead support.