Setup Environment for Google AppEngine Java Project

This blog presents tips and techniques on how to set up environment for deploying Java web app on Google AppEngine using GCloud SDK. Same environment can as well be used for deploying Spring boot web app. Following steps are described later:

  • Install Google Cloud SDK
  • Install Cloud SDK Appengine Java component
  • Create Appengine project in Google Cloud Console
  • Authorize GCloud
  • Configure Appengine project using GCloud

Install Google Cloud SDK

Download and install Google Cloud SDK. The instructions for downloading and installing Google Cloud SDK can be found on Installing Cloud SDK page. Unzip or Untar the downloaded file and go to the google-cloud-sdk folder. Execute install.sh or install.bat appropriately from google cloud sdk folder based on the OS version for setting up Google Cloud SDK. Once done with installation, initialize GCloud SDK by executing the following command from google-cloud-sdk/bin folder.

gcloud init

Install Cloud SDK Appengine Java Component

Execute following command to install cloud SDK app engine java component

gcloud components install app-engine-java

Create Appengine project in Google Cloud Console

Login to Google Cloud Console. Create new Appengine project as shown in the screenshot given below.

Figure 1. Google Cloud Console Dashboard

Above represents the Google cloud console dashboard. Menu lists down the already existing projects you may have created. In above diagram, the project such as Tutosphere is displayed. Click on three dots on Menu. This would open up another window listing down all the projects and a button to add new project as shown in the screemshot show below:

Figure 2. Google Appengine Project List

Click on + (plus) button to add new project. Another dialog box will open up as shown in the diagran given below. Give a project name and create the project.

Figure 3. Create Appegine Project

 

Authorize GCloud to access Google Cloud Platform

Executing following command would take you to the google website and ask you to authorize with one of the accounts. Choose account using which you access the Google Cloud Console.

gcloud auth login

Configure Appengine project

Login to Google Cloud Console, select appengine project and get the appengine project id (Project ID). The following screenshot represents project id, perfect-ray-167007.

Execute following command with the copied project id and set the project. Command such as gcloud config set is used to set Cloud SDK property. In the command given below, Cloud SDK project property is set.

gcloud config set project APPENGINE_PROJECT_ID

Once done with above, you are all set to deploy your Java web app on Google Appengine. In an upcoming article, you will learn about how to deploy Spring boot web app on Google Appengine.

Ajitesh Kumar

I have been recently working in the area of Data analytics including Data Science and Machine Learning / Deep Learning. I am also passionate about different technologies including programming languages such as Java/JEE, Javascript, Python, R, Julia, etc, and technologies such as Blockchain, mobile computing, cloud-native technologies, application security, cloud computing platforms, big data, etc. I would love to connect with you on Linkedin. Check out my latest book titled as First Principles Thinking: Building winning products using first principles thinking.

Recent Posts

Agentic Reasoning Design Patterns in AI: Examples

In recent years, artificial intelligence (AI) has evolved to include more sophisticated and capable agents,…

1 month ago

LLMs for Adaptive Learning & Personalized Education

Adaptive learning helps in tailoring learning experiences to fit the unique needs of each student.…

2 months ago

Sparse Mixture of Experts (MoE) Models: Examples

With the increasing demand for more powerful machine learning (ML) systems that can handle diverse…

2 months ago

Anxiety Disorder Detection & Machine Learning Techniques

Anxiety is a common mental health condition that affects millions of people around the world.…

2 months ago

Confounder Features & Machine Learning Models: Examples

In machine learning, confounder features or variables can significantly affect the accuracy and validity of…

2 months ago

Credit Card Fraud Detection & Machine Learning

Last updated: 26 Sept, 2024 Credit card fraud detection is a major concern for credit…

2 months ago