This tutorial shows how to prepare your local machine for Java development, including developing Java apps that run on Google Cloud. Follow these steps to install Java and relevant tools.
Tip: If you want to get started quickly, Cloud Shell Editor provides IDE support for the full development cycle of Google Kubernetes Engine and Cloud Run applications. Cloud Shell Editor is based on Code - OSS and comes with the Google Cloud CLI and Cloud Code tools preinstalled.Objectives
- Install a JDK (Java Development Kit).
- Install a build automation tool.
- Install the gcloud CLI.
- (Optional) Install an IDE or editor.
- (Optional) Install IDE Google Cloud plugin.
- Install the Cloud Client Libraries for Java.
- Set up authentication.
Install a JDK (Java Development Kit)
You may choose any Java distribution of your choice by ensuring that the following environment variables are set:
- JAVA_HOME: Points to the base of the JDK installation.
- PATH: Includes
$JAVA_HOME/bin.
Eclipse Temurin is the recommended OpenJDK (Java Development Kit) distribution for use with Google Cloud. Temurin is open-source licensed, Java SE TCK-certified, and tested to ensure production-quality performance and security.
(Recommended) Installing Temurin
Temurin's installation instructions vary by operating system.
- Binaries are available for download.
- For Docker containers, use the official 'eclipse-temurin' image.
If you are using Compute Engine boot images, you can use the following installation scripts.
CentOS/RHEL/Rocky
- Determine the major version of CentOS/RHEL/Rocky Linux:
eval "$(grep VERSION_ID /etc/os-release)" eval "$(grep ^ID= /etc/os-release)" OLD_IFS=$IFS IFS='.' read -ra split_version
Web Proxy Viewer | New URL | Original Page