| # Google Cloud Java Client Libraries |
| |
| > Java idiomatic client for [Google Cloud Platform][cloud-platform] services. |
| |
| * [Java on Google Cloud][cloud-java] |
| |
| ## Supported APIs |
| |
| Libraries are available on GitHub and Maven Central for developing Java applications that interact with individual Google Cloud services: |
| |
| [//]: # (API_TABLE_START) |
| |
| | Client | Release Level | Version | |
| | ------ | ------------- | ------- | |
| | [AI Platform Notebooks](https://github.com/googleapis/google-cloud-java/tree/main/java-notebooks) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-notebooks&core=gav) | |
| | [API Gateway](https://github.com/googleapis/google-cloud-java/tree/main/java-api-gateway) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-api-gateway&core=gav) | |
| | [Access Approval](https://github.com/googleapis/google-cloud-java/tree/main/java-accessapproval) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-accessapproval&core=gav) | |
| | [Apigee Connect](https://github.com/googleapis/google-cloud-java/tree/main/java-apigee-connect) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-apigee-connect&core=gav) | |
| | [App Engine Admin API](https://github.com/googleapis/google-cloud-java/tree/main/java-appengine-admin) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-appengine-admin&core=gav) | |
| | [Artifact Registry](https://github.com/googleapis/google-cloud-java/tree/main/java-artifact-registry) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-artifact-registry&core=gav) | |
| | [Asset Inventory](https://github.com/googleapis/google-cloud-java/tree/main/java-asset) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-asset&core=gav) | |
| | [Assured Workloads for Government](https://github.com/googleapis/google-cloud-java/tree/main/java-assured-workloads) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-assured-workloads&core=gav) | |
| | [Auto ML](https://github.com/googleapis/google-cloud-java/tree/main/java-automl) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-automl&core=gav) | |
| | [BigQuery](https://github.com/googleapis/java-bigquery) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-bigquery&core=gav) | |
| | [BigQuery Connection](https://github.com/googleapis/google-cloud-java/tree/main/java-bigqueryconnection) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-bigqueryconnection&core=gav) | |
| | [BigQuery Data Transfer Service](https://github.com/googleapis/google-cloud-java/tree/main/java-bigquerydatatransfer) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-bigquerydatatransfer&core=gav) | |
| | [BigQuery Reservation](https://github.com/googleapis/google-cloud-java/tree/main/java-bigqueryreservation) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-bigqueryreservation&core=gav) | |
| | [BigQuery Storage](https://github.com/googleapis/java-bigquerystorage) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-bigquerystorage&core=gav) | |
| | [Bigtable](https://github.com/googleapis/java-bigtable) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-bigtable&core=gav) | |
| | [Bigtable Hbase Client](https://github.com/googleapis/java-bigtable-hbase) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud.bigtable%20AND%20a:bigtable-client-parent&core=gav) | |
| | [Billing](https://github.com/googleapis/google-cloud-java/tree/main/java-billing) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-billing&core=gav) | |
| | [Billing Budgets](https://github.com/googleapis/google-cloud-java/tree/main/java-billingbudgets) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-billingbudgets&core=gav) | |
| | [Binary Authorization](https://github.com/googleapis/google-cloud-java/tree/main/java-binary-authorization) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-binary-authorization&core=gav) | |
| | [Build](https://github.com/googleapis/google-cloud-java/tree/main/java-cloudbuild) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-build&core=gav) | |
| | [CCAI Insights](https://github.com/googleapis/google-cloud-java/tree/main/java-contact-center-insights) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-contact-center-insights&core=gav) | |
| | [Certificate Authority Service](https://github.com/googleapis/google-cloud-java/tree/main/java-security-private-ca) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-security-private-ca&core=gav) | |
| | [Channel Services](https://github.com/googleapis/google-cloud-java/tree/main/java-channel) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-channel&core=gav) | |
| | [Composer](https://github.com/googleapis/google-cloud-java/tree/main/java-orchestration-airflow) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-orchestration-airflow&core=gav) | |
| | [Compute Engine](https://github.com/googleapis/google-cloud-java/tree/main/java-compute) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-compute&core=gav) | |
| | [Container Analysis](https://github.com/googleapis/google-cloud-java/tree/main/java-containeranalysis) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-containeranalysis&core=gav) | |
| | [DNS](https://github.com/googleapis/google-cloud-java/tree/main/java-dns) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-dns&core=gav) | |
| | [Data Catalog](https://github.com/googleapis/google-cloud-java/tree/main/java-datacatalog) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-datacatalog&core=gav) | |
| | [Data Fusion](https://github.com/googleapis/google-cloud-java/tree/main/java-data-fusion) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-data-fusion&core=gav) | |
| | [Data Loss Prevention](https://github.com/googleapis/google-cloud-java/tree/main/java-dlp) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-dlp&core=gav) | |
| | [Database Migration Service](https://github.com/googleapis/google-cloud-java/tree/main/java-dms) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-dms&core=gav) | |
| | [Dataplex](https://github.com/googleapis/google-cloud-java/tree/main/java-dataplex) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-dataplex&core=gav) | |
| | [Dataproc](https://github.com/googleapis/google-cloud-java/tree/main/java-dataproc) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-dataproc&core=gav) | |
| | [Dataproc Metastore](https://github.com/googleapis/google-cloud-java/tree/main/java-dataproc-metastore) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-dataproc-metastore&core=gav) | |
| | [Datastore](https://github.com/googleapis/java-datastore) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-datastore&core=gav) | |
| | [Datastream](https://github.com/googleapis/google-cloud-java/tree/main/java-datastream) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-datastream&core=gav) | |
| | [Debugger](https://github.com/googleapis/google-cloud-java/tree/main/java-debugger-client) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-debugger-client&core=gav) | |
| | [Deploy](https://github.com/googleapis/google-cloud-java/tree/main/java-deploy) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-deploy&core=gav) | |
| | [Dialogflow API](https://github.com/googleapis/google-cloud-java/tree/main/java-dialogflow) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-dialogflow&core=gav) | |
| | [Document AI](https://github.com/googleapis/google-cloud-java/tree/main/java-document-ai) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-document-ai&core=gav) | |
| | [Domains](https://github.com/googleapis/google-cloud-java/tree/main/java-domains) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-domains&core=gav) | |
| | [Essential Contacts API](https://github.com/googleapis/google-cloud-java/tree/main/java-essential-contacts) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-essential-contacts&core=gav) | |
| | [Eventarc](https://github.com/googleapis/google-cloud-java/tree/main/java-eventarc) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-eventarc&core=gav) | |
| | [Filestore API](https://github.com/googleapis/google-cloud-java/tree/main/java-filestore) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-filestore&core=gav) | |
| | [Firestore](https://github.com/googleapis/java-firestore) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-firestore&core=gav) | |
| | [Fleet Routing](https://github.com/googleapis/google-cloud-java/tree/main/java-optimization) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-optimization&core=gav) | |
| | [Functions](https://github.com/googleapis/google-cloud-java/tree/main/java-functions) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-functions&core=gav) | |
| | [GKE Hub API](https://github.com/googleapis/google-cloud-java/tree/main/java-gkehub) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-gkehub&core=gav) | |
| | [Gaming](https://github.com/googleapis/google-cloud-java/tree/main/java-game-servers) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-game-servers&core=gav) | |
| | [IAM](https://github.com/googleapis/google-cloud-java/tree/main/java-iam) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-iam-policy&core=gav) | |
| | [IAM Admin API](https://github.com/googleapis/google-cloud-java/tree/main/java-iam-admin) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-iam-admin&core=gav) | |
| | [IAM Policy Troubleshooter API](https://github.com/googleapis/google-cloud-java/tree/main/java-policy-troubleshooter) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-policy-troubleshooter&core=gav) | |
| | [IAM Service Account Credentials API](https://github.com/googleapis/google-cloud-java/tree/main/java-iamcredentials) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-iamcredentials&core=gav) | |
| | [Identity Access Context Manager](https://github.com/googleapis/google-cloud-java/tree/main/java-accesscontextmanager) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-identity-accesscontextmanager&core=gav) | |
| | [Internet of Things (IoT) Core](https://github.com/googleapis/google-cloud-java/tree/main/java-iot) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-iot&core=gav) | |
| | [Intrusion Detection System](https://github.com/googleapis/google-cloud-java/tree/main/java-ids) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-ids&core=gav) | |
| | [Key Management Service](https://github.com/googleapis/google-cloud-java/tree/main/java-kms) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-kms&core=gav) | |
| | [Kubernetes Engine](https://github.com/googleapis/google-cloud-java/tree/main/java-container) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-container&core=gav) | |
| | [Logging](https://github.com/googleapis/java-logging) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-logging&core=gav) | |
| | [Managed Service for Microsoft Active Directory](https://github.com/googleapis/google-cloud-java/tree/main/java-managed-identities) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-managed-identities&core=gav) | |
| | [Memcache](https://github.com/googleapis/google-cloud-java/tree/main/java-memcache) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-memcache&core=gav) | |
| | [Monitoring Dashboards](https://github.com/googleapis/google-cloud-java/tree/main/java-monitoring-dashboards) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-monitoring-dashboard&core=gav) | |
| | [Natural Language](https://github.com/googleapis/google-cloud-java/tree/main/java-language) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-language&core=gav) | |
| | [Network Connectivity Center](https://github.com/googleapis/google-cloud-java/tree/main/java-networkconnectivity) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-networkconnectivity&core=gav) | |
| | [Network Management API](https://github.com/googleapis/google-cloud-java/tree/main/java-network-management) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-network-management&core=gav) | |
| | [OS Config API](https://github.com/googleapis/google-cloud-java/tree/main/java-os-config) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-os-config&core=gav) | |
| | [OS Login](https://github.com/googleapis/google-cloud-java/tree/main/java-os-login) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-os-login&core=gav) | |
| | [Organization Policy](https://github.com/googleapis/google-cloud-java/tree/main/java-orgpolicy) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-orgpolicy&core=gav) | |
| | [Profiler](https://github.com/googleapis/google-cloud-java/tree/main/java-profiler) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-profiler&core=gav) | |
| | [Pub/Sub](https://github.com/googleapis/java-pubsub) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-pubsub&core=gav) | |
| | [Pub/Sub Group Kafka Connector](https://github.com/googleapis/java-pubsub-group-kafka-connector) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:pubsub-group-kafka-connector&core=gav) | |
| | [Pub/Sub Lite](https://github.com/googleapis/java-pubsublite) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-pubsublite&core=gav) | |
| | [Pub/Sub Lite Kafka Shim](https://github.com/googleapis/java-pubsublite-kafka) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:pubsublite-kafka&core=gav) | |
| | [Pub/Sub Lite Spark Connector](https://github.com/googleapis/java-pubsublite-spark) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:pubsublite-spark-sql-streaming&core=gav) | |
| | [Recommender](https://github.com/googleapis/google-cloud-java/tree/main/java-recommender) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-recommender&core=gav) | |
| | [Redis](https://github.com/googleapis/google-cloud-java/tree/main/java-redis) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-redis&core=gav) | |
| | [Resource Manager API](https://github.com/googleapis/google-cloud-java/tree/main/java-resourcemanager) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-resourcemanager&core=gav) | |
| | [Resource Settings API](https://github.com/googleapis/google-cloud-java/tree/main/java-resource-settings) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-resource-settings&core=gav) | |
| | [Retail](https://github.com/googleapis/google-cloud-java/tree/main/java-retail) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-retail&core=gav) | |
| | [Routes API](https://github.com/googleapis/google-cloud-java/tree/main/java-maps-routing) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.maps%20AND%20a:google-maps-routing&core=gav) | |
| | [Scheduler](https://github.com/googleapis/google-cloud-java/tree/main/java-scheduler) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-scheduler&core=gav) | |
| | [Secret Management](https://github.com/googleapis/google-cloud-java/tree/main/java-secretmanager) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-secretmanager&core=gav) | |
| | [Security Command Center](https://github.com/googleapis/google-cloud-java/tree/main/java-securitycenter) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-securitycenter&core=gav) | |
| | [Security Scanner](https://github.com/googleapis/google-cloud-java/tree/main/java-websecurityscanner) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-websecurityscanner&core=gav) | |
| | [Serverless VPC Access](https://github.com/googleapis/google-cloud-java/tree/main/java-vpcaccess) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-vpcaccess&core=gav) | |
| | [Service Control API](https://github.com/googleapis/google-cloud-java/tree/main/java-service-control) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-service-control&core=gav) | |
| | [Service Directory](https://github.com/googleapis/google-cloud-java/tree/main/java-servicedirectory) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-servicedirectory&core=gav) | |
| | [Service Management API](https://github.com/googleapis/google-cloud-java/tree/main/java-service-management) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-service-management&core=gav) | |
| | [Service Usage](https://github.com/googleapis/google-cloud-java/tree/main/java-service-usage) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-service-usage&core=gav) | |
| | [Shell](https://github.com/googleapis/google-cloud-java/tree/main/java-shell) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-shell&core=gav) | |
| | [Spanner](https://github.com/googleapis/java-spanner) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-spanner&core=gav) | |
| | [Spanner JDBC](https://github.com/googleapis/java-spanner-jdbc) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-spanner-jdbc&core=gav) | |
| | [Speech](https://github.com/googleapis/google-cloud-java/tree/main/java-speech) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-speech&core=gav) | |
| | [Stackdriver Monitoring](https://github.com/googleapis/google-cloud-java/tree/main/java-monitoring) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-monitoring&core=gav) | |
| | [Stackdriver Trace](https://github.com/googleapis/google-cloud-java/tree/main/java-trace) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-trace&core=gav) | |
| | [Storage](https://github.com/googleapis/java-storage) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-storage&core=gav) | |
| | [Storage Transfer Service](https://github.com/googleapis/google-cloud-java/tree/main/java-storage-transfer) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-storage-transfer&core=gav) | |
| | [TPU](https://github.com/googleapis/google-cloud-java/tree/main/java-tpu) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-tpu&core=gav) | |
| | [Talent Solution](https://github.com/googleapis/google-cloud-java/tree/main/java-talent) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-talent&core=gav) | |
| | [Tasks](https://github.com/googleapis/google-cloud-java/tree/main/java-tasks) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-tasks&core=gav) | |
| | [Text-to-Speech](https://github.com/googleapis/google-cloud-java/tree/main/java-texttospeech) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-texttospeech&core=gav) | |
| | [Translation](https://github.com/googleapis/google-cloud-java/tree/main/java-translate) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-translate&core=gav) | |
| | [VM Migration](https://github.com/googleapis/google-cloud-java/tree/main/java-vmmigration) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-vmmigration&core=gav) | |
| | [Vertex AI](https://github.com/googleapis/google-cloud-java/tree/main/java-aiplatform) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-aiplatform&core=gav) | |
| | [Video Intelligence](https://github.com/googleapis/google-cloud-java/tree/main/java-video-intelligence) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-video-intelligence&core=gav) | |
| | [Video Transcoder](https://github.com/googleapis/google-cloud-java/tree/main/java-video-transcoder) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-video-transcoder&core=gav) | |
| | [Vision](https://github.com/googleapis/google-cloud-java/tree/main/java-vision) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-vision&core=gav) | |
| | [Web Risk](https://github.com/googleapis/google-cloud-java/tree/main/java-webrisk) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-webrisk&core=gav) | |
| | [Workflow Executions](https://github.com/googleapis/google-cloud-java/tree/main/java-workflow-executions) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-workflow-executions&core=gav) | |
| | [Workflows](https://github.com/googleapis/google-cloud-java/tree/main/java-workflows) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-workflows&core=gav) | |
| | [Workspace Add-ons API](https://github.com/googleapis/google-cloud-java/tree/main/java-gsuite-addons) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-gsuite-addons&core=gav) | |
| | [reCAPTCHA Enterprise](https://github.com/googleapis/google-cloud-java/tree/main/java-recaptchaenterprise) | [![stable][stable-stability]][stable-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-recaptchaenterprise&core=gav) | |
| | [API Keys API](https://github.com/googleapis/google-cloud-java/tree/main/java-apikeys) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-apikeys&core=gav) | |
| | [Address Validation API](https://github.com/googleapis/google-cloud-java/tree/main/java-maps-addressvalidation) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.maps%20AND%20a:google-maps-addressvalidation&core=gav) | |
| | [Advisory Notifications API](https://github.com/googleapis/google-cloud-java/tree/main/java-advisorynotifications) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-advisorynotifications&core=gav) | |
| | [AlloyDB](https://github.com/googleapis/google-cloud-java/tree/main/java-alloydb) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-alloydb&core=gav) | |
| | [Analytics Admin](https://github.com/googleapis/google-cloud-java/tree/main/java-analytics-admin) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.analytics%20AND%20a:google-analytics-admin&core=gav) | |
| | [Analytics Data](https://github.com/googleapis/google-cloud-java/tree/main/java-analytics-data) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.analytics%20AND%20a:google-analytics-data&core=gav) | |
| | [Analytics Hub](https://github.com/googleapis/google-cloud-java/tree/main/java-bigquery-data-exchange) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-bigquery-data-exchange&core=gav) | |
| | [Analytics Hub API](https://github.com/googleapis/google-cloud-java/tree/main/java-analyticshub) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-analyticshub&core=gav) | |
| | [Anthos Multicloud](https://github.com/googleapis/google-cloud-java/tree/main/java-gke-multi-cloud) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-gke-multi-cloud&core=gav) | |
| | [Area 120 Tables](https://github.com/googleapis/google-cloud-java/tree/main/java-area120-tables) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.area120%20AND%20a:google-area120-tables&core=gav) | |
| | [Backup for GKE](https://github.com/googleapis/google-cloud-java/tree/main/java-gke-backup) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-gke-backup&core=gav) | |
| | [Bare Metal Solution](https://github.com/googleapis/google-cloud-java/tree/main/java-bare-metal-solution) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-bare-metal-solution&core=gav) | |
| | [Batch](https://github.com/googleapis/google-cloud-java/tree/main/java-batch) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-batch&core=gav) | |
| | [BeyondCorp AppConnections](https://github.com/googleapis/google-cloud-java/tree/main/java-beyondcorp-appconnections) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-beyondcorp-appconnections&core=gav) | |
| | [BeyondCorp AppConnectors](https://github.com/googleapis/google-cloud-java/tree/main/java-beyondcorp-appconnectors) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-beyondcorp-appconnectors&core=gav) | |
| | [BeyondCorp AppGateways](https://github.com/googleapis/google-cloud-java/tree/main/java-beyondcorp-appgateways) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-beyondcorp-appgateways&core=gav) | |
| | [BeyondCorp ClientConnectorServices](https://github.com/googleapis/google-cloud-java/tree/main/java-beyondcorp-clientconnectorservices) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-beyondcorp-clientconnectorservices&core=gav) | |
| | [BeyondCorp ClientGateways](https://github.com/googleapis/google-cloud-java/tree/main/java-beyondcorp-clientgateways) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-beyondcorp-clientgateways&core=gav) | |
| | [BigLake](https://github.com/googleapis/google-cloud-java/tree/main/java-biglake) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-biglake&core=gav) | |
| | [BigQuery DataPolicy API](https://github.com/googleapis/google-cloud-java/tree/main/java-bigquerydatapolicy) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-bigquerydatapolicy&core=gav) | |
| | [BigQuery Migration](https://github.com/googleapis/google-cloud-java/tree/main/java-bigquerymigration) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-bigquerymigration&core=gav) | |
| | [Certificate Manager](https://github.com/googleapis/google-cloud-java/tree/main/java-certificate-manager) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-certificate-manager&core=gav) | |
| | [Commerce Consumer Procurement](https://github.com/googleapis/google-cloud-java/tree/main/java-cloudcommerceconsumerprocurement) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-cloudcommerceconsumerprocurement&core=gav) | |
| | [Confidential Computing API](https://github.com/googleapis/google-cloud-java/tree/main/java-confidentialcomputing) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-confidentialcomputing&core=gav) | |
| | [Connect Gateway API](https://github.com/googleapis/google-cloud-java/tree/main/java-gke-connect-gateway) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-gke-connect-gateway&core=gav) | |
| | [Data Labeling](https://github.com/googleapis/google-cloud-java/tree/main/java-datalabeling) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-datalabeling&core=gav) | |
| | [Data Lineage](https://github.com/googleapis/google-cloud-java/tree/main/java-datalineage) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-datalineage&core=gav) | |
| | [Dataflow](https://github.com/googleapis/google-cloud-java/tree/main/java-dataflow) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-dataflow&core=gav) | |
| | [Dataform](https://github.com/googleapis/google-cloud-java/tree/main/java-dataform) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-dataform&core=gav) | |
| | [Dialogflow CX](https://github.com/googleapis/google-cloud-java/tree/main/java-dialogflow-cx) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-dialogflow-cx&core=gav) | |
| | [Discovery Engine API](https://github.com/googleapis/google-cloud-java/tree/main/java-discoveryengine) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-discoveryengine&core=gav) | |
| | [Distributed Edge](https://github.com/googleapis/google-cloud-java/tree/main/java-distributedcloudedge) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-distributedcloudedge&core=gav) | |
| | [Document AI Warehouse](https://github.com/googleapis/google-cloud-java/tree/main/java-contentwarehouse) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-contentwarehouse&core=gav) | |
| | [Enterprise Knowledge Graph](https://github.com/googleapis/google-cloud-java/tree/main/java-enterpriseknowledgegraph) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-enterpriseknowledgegraph&core=gav) | |
| | [Error Reporting](https://github.com/googleapis/google-cloud-java/tree/main/java-errorreporting) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-errorreporting&core=gav) | |
| | [Eventarc Publishing](https://github.com/googleapis/google-cloud-java/tree/main/java-eventarc-publishing) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-eventarc-publishing&core=gav) | |
| | [KMS Inventory API](https://github.com/googleapis/google-cloud-java/tree/main/java-kmsinventory) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-kmsinventory&core=gav) | |
| | [Life Sciences](https://github.com/googleapis/google-cloud-java/tree/main/java-life-sciences) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-life-sciences&core=gav) | |
| | [Live Stream API](https://github.com/googleapis/google-cloud-java/tree/main/java-video-live-stream) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-live-stream&core=gav) | |
| | [Logging Logback Appender](https://github.com/googleapis/java-logging-logback) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-logging-logback&core=gav) | |
| | [Logging Servlet Initializer](https://github.com/googleapis/java-logging-servlet-initializer) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-logging-servlet-initializer&core=gav) | |
| | [Maps Platform Datasets API](https://github.com/googleapis/google-cloud-java/tree/main/java-maps-mapsplatformdatasets) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.maps%20AND%20a:google-maps-mapsplatformdatasets&core=gav) | |
| | [Media Translation API](https://github.com/googleapis/google-cloud-java/tree/main/java-mediatranslation) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-mediatranslation&core=gav) | |
| | [Monitoring Metrics Scopes](https://github.com/googleapis/google-cloud-java/tree/main/java-monitoring-metricsscope) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-monitoring-metricsscope&core=gav) | |
| | [NIO Filesystem Provider for Storage](https://github.com/googleapis/java-storage-nio) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-nio&core=gav) | |
| | [Network Security API](https://github.com/googleapis/google-cloud-java/tree/main/java-network-security) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-network-security&core=gav) | |
| | [Phishing Protection](https://github.com/googleapis/google-cloud-java/tree/main/java-phishingprotection) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-phishingprotection&core=gav) | |
| | [Private Catalog](https://github.com/googleapis/google-cloud-java/tree/main/java-private-catalog) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-private-catalog&core=gav) | |
| | [Pub/Sub Lite Flink Connector](https://github.com/googleapis/java-pubsublite-flink) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-pubsublite-flink&core=gav) | |
| | [Public Certificate Authority](https://github.com/googleapis/google-cloud-java/tree/main/java-publicca) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-publicca&core=gav) | |
| | [Recommendations AI](https://github.com/googleapis/google-cloud-java/tree/main/java-recommendations-ai) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-recommendations-ai&core=gav) | |
| | [Registry API](https://github.com/googleapis/google-cloud-java/tree/main/java-apigee-registry) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-apigee-registry&core=gav) | |
| | [Run](https://github.com/googleapis/google-cloud-java/tree/main/java-run) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-run&core=gav) | |
| | [Security Command Center Settings API](https://github.com/googleapis/google-cloud-java/tree/main/java-securitycenter-settings) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-securitycenter-settings&core=gav) | |
| | [Storage Insights API](https://github.com/googleapis/google-cloud-java/tree/main/java-storageinsights) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-storageinsights&core=gav) | |
| | [Support API](https://github.com/googleapis/google-cloud-java/tree/main/java-cloudsupport) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-cloudsupport&core=gav) | |
| | [VMware Engine](https://github.com/googleapis/google-cloud-java/tree/main/java-vmwareengine) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-vmwareengine&core=gav) | |
| | [Video Stitcher API](https://github.com/googleapis/google-cloud-java/tree/main/java-video-stitcher) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-video-stitcher&core=gav) | |
| | [Workstations](https://github.com/googleapis/google-cloud-java/tree/main/java-workstations) | [![preview][preview-stability]][preview-description] | [](https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-workstations&core=gav) | |
| |
| [//]: # (API_TABLE_END) |
| |
| If the service is not listed, [google-api-java-client][google-api-java-client-services] interfaces with additional Google Cloud APIs using a legacy REST interface. |
| |
| *When building Java applications, preference should be given to the libraries listed in the table.* |
| |
| |
| |
| ## Specifying a Project ID |
| |
| Most `google-cloud` libraries require a project ID. There are multiple ways to specify this project ID. |
| |
| 1. When using `google-cloud` libraries from within Compute/App Engine, there's no need to specify a project ID. It is automatically inferred from the production environment. |
| 2. When using `google-cloud` elsewhere, you can do one of the following: |
| * Supply the project ID when building the service options. For example, to use Datastore from a project with ID "PROJECT_ID", you can write: |
| |
| ```java |
| Datastore datastore = DatastoreOptions.newBuilder().setProjectId("PROJECT_ID").build().getService(); |
| ``` |
| * Specify the environment variable `GOOGLE_CLOUD_PROJECT` to be your desired project ID. |
| * Set the project ID using the [Google Cloud SDK](https://cloud.google.com/sdk/?hl=en). To use the SDK, [download the SDK](https://cloud.google.com/sdk/?hl=en) if you haven't already, and set the project ID from the command line. For example: |
| |
| ``` |
| gcloud config set project PROJECT_ID |
| ``` |
| |
| `google-cloud` determines the project ID from the following sources in the listed order, stopping once it finds a value: |
| |
| 1. The project ID supplied when building the service options |
| 2. Project ID specified by the environment variable `GOOGLE_CLOUD_PROJECT` |
| 3. The App Engine / Compute Engine project ID |
| 4. The project ID specified in the JSON credentials file pointed by the `GOOGLE_APPLICATION_CREDENTIALS` environment variable |
| 5. The Google Cloud SDK project ID |
| |
| In cases where the library may expect a project ID explicitly, we provide a helper that can provide the inferred project ID: |
| ```java |
| import com.google.cloud.ServiceOptions; |
| ... |
| String projectId = ServiceOptions.getDefaultProjectId(); |
| ``` |
| |
| ## Authentication |
| |
| `google-cloud-java` uses |
| [https://github.com/googleapis/google-auth-library-java](https://github.com/googleapis/google-auth-library-java) |
| to authenticate requests. `google-auth-library-java` supports a wide range of authentication types; |
| see the project's [README](https://github.com/google/google-auth-library-java/blob/main/README.md) |
| and [javadoc](https://cloud.google.com/java/docs/reference/google-auth-library/latest/overview) for more |
| details. |
| |
| ### Google Cloud Platform environment |
| |
| When using Google Cloud libraries from a Google Cloud Platform environment such as Compute Engine, |
| Kubernetes Engine, or App Engine, no additional authentication steps are necessary. |
| |
| For example: |
| |
| ```java |
| Storage storage = StorageOptions.getDefaultInstance().getService(); |
| ``` |
| |
| or: |
| |
| ```java |
| CloudTasksClient cloudTasksClient = CloudTasksClient.create(); |
| ``` |
| |
| ### Other environments |
| |
| #### Using a service account (recommended) |
| |
| 1. [Generate a JSON service account key](https://cloud.google.com/storage/docs/authentication?hl=en#service_accounts). |
| |
| 2. After downloading that key, you must do one of the following: |
| * Define the environment variable GOOGLE_APPLICATION_CREDENTIALS to be the location of the key. |
| For example: |
| ```bash |
| export GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/key.json |
| ``` |
| * Supply the JSON credentials file when building the service options. For example, this Storage |
| object has the necessary permissions to interact with your Google Cloud Storage data: |
| ```java |
| Storage storage = StorageOptions.newBuilder() |
| .setCredentials(ServiceAccountCredentials.fromStream(new FileInputStream("/path/to/my/key.json"))) |
| .build() |
| .getService(); |
| ``` |
| |
| #### Local development/testing |
| |
| If running locally for development/testing, you can use the [Google Cloud SDK](https://cloud.google.com/sdk/). |
| Create Application Default Credentials with `gcloud auth application-default login`, and then |
| `google-cloud` will automatically detect such credentials. |
| |
| #### Existing OAuth2 access token |
| |
| If you already have an OAuth2 access token, you can use it to authenticate (notice that in this case, the |
| access token will not be automatically refreshed): |
| |
| ```java |
| Credentials credentials = GoogleCredentials.create(new AccessToken(accessToken, expirationTime)); |
| Storage storage = StorageOptions.newBuilder() |
| .setCredentials(credentials) |
| .build() |
| .getService(); |
| ``` |
| |
| or: |
| |
| ```java |
| Credentials credentials = GoogleCredentials.create(new AccessToken(accessToken, expirationTime)); |
| CloudTasksSettings cloudTasksSettings = CloudTasksSettings.newBuilder() |
| .setCredentialProvider(FixedCredentialsProvider.create(credentials)) |
| .build(); |
| CloudTasksClient cloudTasksClient = CloudTasksClient.create(cloudTasksSettings); |
| ``` |
| |
| ### Application Default Credentials |
| |
| If no credentials are provided, `google-cloud` will attempt to detect them from the environment |
| using `GoogleCredentials.getApplicationDefault()` which will search for Application Default |
| Credentials in the following locations (in order): |
| |
| 1. The credentials file pointed to by the `GOOGLE_APPLICATION_CREDENTIALS` environment variable |
| 2. Credentials provided by the Google Cloud SDK `gcloud auth application-default login` command |
| 3. Google App Engine built-in credentials |
| 4. Google Cloud Shell built-in credentials |
| 5. Google Compute Engine built-in credentials |
| |
| ## Troubleshooting |
| |
| To get help, follow the instructions in the [Troubleshooting document](https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md). |
| |
| ## Configuring a Proxy |
| |
| Google Cloud client libraries use HTTPS and gRPC in underlying communication |
| with the services. |
| In both protocols, you can configure a proxy using `https.proxyHost` |
| and (optional) `https.proxyPort` properties. |
| |
| ### gRPC Custom Proxy Configuration |
| |
| For a more custom proxy with gRPC, you will need supply a `ProxyDetector` to |
| the `ManagedChannelBuilder`: |
| |
| ```java |
| import com.google.api.core.ApiFunction; |
| import com.google.api.gax.rpc.TransportChannelProvider; |
| import com.google.cloud.tasks.v2.CloudTasksClient; |
| import com.google.cloud.tasks.v2.CloudTasksSettings; |
| import com.google.cloud.tasks.v2.stub.CloudTasksStubSettings; |
| import io.grpc.HttpConnectProxiedSocketAddress; |
| import io.grpc.ManagedChannelBuilder; |
| import io.grpc.ProxiedSocketAddress; |
| import io.grpc.ProxyDetector; |
| |
| import javax.annotation.Nullable; |
| import java.io.IOException; |
| import java.net.InetSocketAddress; |
| import java.net.SocketAddress; |
| |
| public CloudTasksClient getService() throws IOException { |
| TransportChannelProvider transportChannelProvider = |
| CloudTasksStubSettings.defaultGrpcTransportProviderBuilder() |
| .setChannelConfigurator( |
| new ApiFunction<ManagedChannelBuilder, ManagedChannelBuilder>() { |
| @Override |
| public ManagedChannelBuilder apply(ManagedChannelBuilder managedChannelBuilder) { |
| return managedChannelBuilder.proxyDetector( |
| new ProxyDetector() { |
| @Nullable |
| @Override |
| public ProxiedSocketAddress proxyFor(SocketAddress socketAddress) |
| throws IOException { |
| return HttpConnectProxiedSocketAddress.newBuilder() |
| .setUsername(PROXY_USERNAME) |
| .setPassword(PROXY_PASSWORD) |
| .setProxyAddress(new InetSocketAddress(PROXY_HOST, PROXY_PORT)) |
| .setTargetAddress((InetSocketAddress) socketAddress) |
| .build(); |
| } |
| }); |
| } |
| }) |
| .build(); |
| CloudTasksSettings cloudTasksSettings = |
| CloudTasksSettings.newBuilder() |
| .setTransportChannelProvider(transportChannelProvider) |
| .build(); |
| return CloudTasksClient.create(cloudTasksSettings); |
| } |
| ``` |
| |
| ## Long Running Operations |
| |
| Long running operations (LROs) are often used for API calls that are expected to |
| take a long time to complete (e.g. provisioning a GCE instance or a Dataflow pipeline). |
| The initial API call creates an "operation" on the server and returns an operation ID |
| to track its progress. |
| |
| Our generated gRPC clients provide a nice interface for starting the operation and |
| then waiting for the operation to complete. This is accomplished by returning an |
| [`OperationFuture`](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture). |
| When you call `get()` on the `OperationFuture` we poll the operation endpoint to |
| check on the operation. These polling operations have a default timeout that |
| varies from service to service and will throw a `java.util.concurrent.CancellationException` |
| with the message: `Task was cancelled.` after that timeout has been reached. |
| |
| ### Configuring LRO Timeouts |
| |
| ```java |
| ClusterControllerSettings.Builder settingsBuilder = ClusterControllerSettings.newBuilder(); |
| TimedRetryAlgorithm timedRetryAlgorithm = OperationTimedPollAlgorithm.create( |
| RetrySettings.newBuilder() |
| .setInitialRetryDelay(Duration.ofMillis(500L)) |
| .setRetryDelayMultiplier(1.5) |
| .setMaxRetryDelay(Duration.ofMillis(5000L)) |
| .setInitialRpcTimeout(Duration.ZERO) // ignored |
| .setRpcTimeoutMultiplier(1.0) // ignored |
| .setMaxRpcTimeout(Duration.ZERO) // ignored |
| .setTotalTimeout(Duration.ofHours(24L)) // set polling timeout to 24 hours |
| .build()); |
| settingsBuilder.createClusterOperationSettings() |
| .setPollingAlgorithm(timedRetryAlgorithm); |
| ClusterControllerClient clusterControllerClient = ClusterControllerClient.create(settingsBuilder.build()); |
| ``` |
| |
| ## Managing Dependencies |
| |
| If you are using more than one Google Cloud client library, we recommend you use one of |
| our Bill of Material (BOM) artifacts to help manage dependency versions. For more information, |
| see [Using the Cloud Client Libraries](https://cloud.google.com/java/docs/bom). |
| |
| ## Java Versions |
| |
| Java 8 or above is required for using the clients in this repository. |
| |
| ## Supported Platforms |
| |
| Clients in this repository use either HTTP or gRPC for the transport layer. All |
| HTTP-based clients should work in all environments. |
| |
| For clients that use gRPC, the supported platforms are constrained by the platforms |
| that [Forked Tomcat Native](http://netty.io/wiki/forked-tomcat-native.html) supports, |
| which for architectures means only x86_64, and for operating systems means Mac OS X, |
| Windows, and Linux. Additionally, gRPC constrains the use of platforms with |
| threading restrictions. |
| |
| Thus, the following are not supported: |
| |
| - Android |
| - Consider [Firebase](https://firebase.google.com), which includes many of these APIs. |
| - It is possible to use these libraries in many cases, although it is unsupported. |
| You can find examples, such as [this one](https://github.com/GoogleCloudPlatform/android-docs-samples/tree/main/speech/SpeechRecognitionClient), |
| in this [example repository](https://github.com/GoogleCloudPlatform/android-docs-samples) but consider the risks carefully before using these libraries in an application. |
| - Raspberry Pi (since it runs on the ARM architecture) |
| - Google App Engine Standard Java 7 |
| |
| The following environments should work (among others): |
| |
| - standalone Windows on x86_64 |
| - standalone Mac OS X on x86_64 |
| - standalone Linux on x86_64 |
| - Google Compute Engine (GCE) |
| - Google Container Engine (GKE) |
| - Google App Engine Standard Java 8 (GAE Std J8) |
| - Google App Engine Flex (GAE Flex) |
| - Alpine Linux (Java 11+) |
| |
| ## Testing |
| |
| This library provides tools to help write tests for code that uses google-cloud services. |
| |
| See [TESTING] to read more about using our testing helpers. |
| |
| ## Versioning |
| |
| This library follows [Semantic Versioning](http://semver.org/), with some |
| additional qualifications: |
| |
| 1. Components marked with `@BetaApi` or `@Experimental` are considered to be "0.x" |
| features inside a "1.x" library. This means they can change between minor and |
| patch releases in incompatible ways. These features should not be used by any |
| library "B" that itself has consumers, unless the components of library B that |
| use `@BetaApi` features are also marked with `@BetaApi`. Features marked as |
| `@BetaApi` are on a path to eventually become "1.x" features with the marker |
| removed. |
| |
| **Special exception for google-cloud-java**: google-cloud-java is |
| allowed to depend on `@BetaApi` features in gax-java without declaring the consuming |
| code `@BetaApi`, because gax-java and google-cloud-java move in step |
| with each other. For this reason, gax-java should not be used |
| independently of google-cloud-java. |
| |
| 1. Components marked with `@InternalApi` are technically public, but only |
| because of the limitations of Java's access |
| modifiers. For the purposes of semver, they should be considered private. |
| |
| 1. Interfaces marked with `@InternalExtensionOnly` are public, but should only be |
| implemented by internal classes. For the purposes of semver, we reserve the right |
| to add to these interfaces without default implementations (for Java 7). |
| |
| Please note these clients are currently under active development. Any release versioned 0.x.y is |
| subject to backwards incompatible changes at any time. |
| |
| ### Stable |
| |
| Libraries defined at a Stable quality level are expected to be stable and all updates in the |
| libraries are guaranteed to be backwards-compatible. Any backwards-incompatible changes will lead |
| to the major version increment (1.x.y -> 2.0.0). |
| |
| ### Preview |
| |
| Libraries defined at a Preview quality level are still a work-in-progress and |
| are more likely to get backwards-incompatible updates. Additionally, it's possible for Preview |
| libraries to get deprecated and deleted before ever being promoted to Preview or Stable. |
| |
| ## IDE Plugins |
| |
| If you're using IntelliJ or Eclipse, you can add client libraries to your project using these IDE plugins: |
| * [Cloud Tools for IntelliJ](https://cloud.google.com/tools/intellij/docs/client-libraries?utm_source=github&utm_medium=google-cloud-java&utm_campaign=ToolsforIntelliJ) |
| * [Cloud Tools for Eclipse](https://cloud.google.com/eclipse/docs/libraries?utm_source=github&utm_medium=google-cloud-java&utm_campaign=ToolsforEclipse) |
| |
| Besides adding client libraries, the plugins provide additional functionality, such as service account |
| key management. Refer to the documentation for each plugin for more details. |
| |
| These client libraries can be used on App Engine standard for Java 8 runtime and App Engine flexible |
| (including the Compat runtime). Most of the libraries do not work on the App Engine standard for Java 7 |
| runtime. However, Datastore, Storage, and Bigquery should work. |
| |
| ## Contributing |
| |
| Contributions to this library are always welcome and highly encouraged. |
| |
| See `google-cloud`'s [CONTRIBUTING] documentation and the [shared documentation](https://github.com/googleapis/google-cloud-common/blob/main/contributing/readme.md#how-to-contribute-to-gcloud) for more information on how to get started. |
| |
| Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information. |
| |
| ## License |
| |
| Apache 2.0 - See [LICENSE] for more information. |
| |
| [cloud-java]: https://cloud.google.com/java |
| [stable-stability]: https://img.shields.io/badge/stability-stable-green |
| [stable-description]: #stable |
| [preview-stability]: https://img.shields.io/badge/stability-preview-yellow |
| [preview-description]: #preview |
| [google-api-java-client-services]: https://github.com/googleapis/google-api-java-client-services#supported-google-apis |
| [CONTRIBUTING]:https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md |
| [code-of-conduct]:https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct |
| [LICENSE]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE |
| [TESTING]: https://github.com/googleapis/google-cloud-java/blob/main/TESTING.md |
| [cloud-platform]: https://cloud.google.com/ |
| [cloud-platform-docs]: https://cloud.google.com/docs/ |
| [client-lib-docs]: https://cloud.google.com/java/docs/reference |