Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Java and Kotlin Code samples used on cloud.google.com

License

NotificationsYou must be signed in to change notification settings

GoogleCloudPlatform/java-docs-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Build StatusBuild StatusBuild Status

Open in Cloud Shell

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.

Google Cloud Samples

To browse ready to use code samples checkGoogle Cloud Samples.

Set Up

  1. Set up your Java Development Environment

  2. Clone this repository:

     git clone https://github.com/GoogleCloudPlatform/java-docs-samples.git
  3. 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 theGOOGLE_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.

Contributing

Licensing

Supported Java runtimes

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.

Source Code Headers

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.


[8]ページ先頭

©2009-2025 Movatter.jp