GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — google-cloud-java/java-datastore/samples at main · vverman/google-cloud-java

Expand file tree

/

samples

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

samples

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
install-without-bom
install-without-bom
 
 
native-image-sample
native-image-sample
 
 
snapshot
snapshot
 
 
snippets
snippets
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

README.md

Outline

Getting Started with Datastore Samples

Running a sample using Cloud Shell

The Google Cloud Shell has application default credentials from its compute instance which will allow you to run samples without having to obtain GOOGLE_APPLICATION_CREDENTIALS. Go to the Datastore Client Readme to run each sample in the Cloud Shell.

Running a sample at the command line

  1. First set up the GOOGLE_CLOUD_PROJECT environment variable.

  2. Obtain authentication credentials.

    Create local credentials by running the following command and following the oauth2 flow (read more about the command here):

     gcloud auth application-default login
    

    Or manually set the GOOGLE_APPLICATION_CREDENTIALS environment variable to point to a service account key JSON file path.

    Learn more at Setting Up Authentication for Server to Server Production Applications.

Now you can run a sample:

  1. cd samples/snippets - all samples are located in the java-datastore/samples/snippets directory.
  2. mvn compile exec:java -Dexec.mainClass="com.google.datastore.snippets.TaskList" - this runs the TaskList sample.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.