Setup Environment for Google AppEngine Java Project

0

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.

Google Cloud Console Dashboard

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:

Google Appengine Project List

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.

Create Appegine 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

Ajitesh Kumar

Ajitesh is passionate about various different technologies including programming languages such as Java/JEE, Javascript, PHP, C/C++, mobile programming languages etc, and, computing fundamentals related with cloud-native technologies, application security, cloud computing platforms, mobile apps, big data etc.

He has also authored the book, Building Web Apps with Spring 5 and Angular.
Ajitesh Kumar

Leave A Reply

Time limit is exhausted. Please reload the CAPTCHA.