- Notifications
You must be signed in to change notification settings - Fork2.9k
Java and Kotlin Code samples used on cloud.google.com
License
GoogleCloudPlatform/java-docs-samples
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This repository holds sample code written in Java that demonstrates theGoogle Cloud Platform.
Some samples have accompanying guides on <cloud.google.com>. See respectiveREADME files for details.
To browse ready to use code samples checkGoogle Cloud Samples.
Clone this repository:
git clone https://github.com/GoogleCloudPlatform/java-docs-samples.git
Obtain authentication credentials.
Create local credentials by running the following command and following theoauth2 flow (read more about the commandhere):
gcloud auth application-default login
Or manually set the
GOOGLE_APPLICATION_CREDENTIALS
environment variableto point to a service account key JSON file path.Learn more atSetting Up Authentication for Server to Server Production Applications.
Note: Application Default Credentials is able to implicitly find the credentials as long as the application is running on Compute Engine, Kubernetes Engine, App Engine, or Cloud Functions.
- See theContributing Guide
- SeeLICENSE
Every submitted change has to pass all checks that run on the testing environments with Java 11 and Java 17 runtimes before merging the change to the main branch.We run periodic checks on the environments with Java 8 and Java 21 runtimes but we don't enforce passing these tests at the moment.Because Java 8 is asupported Java runtime in Google Cloud, please configure to build your code sample with Java 8.In exceptional cases, configure to build your code sample using Java 11.
Every file containing source code must include copyright and licenseinformation. This includes any JS/CSS files that you might be serving out tobrowsers. (This is to help well-intentioned people avoid accidental copying thatdoesn't comply with the license.)
Apache header:
Copyright 2022 Google LLCLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
Java is a registered trademark of Oracle and/or its affiliates.
About
Java and Kotlin Code samples used on cloud.google.com
Topics
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.