Cloud Tools for Eclipse 在 Eclipse 内提供了一个向导,用于在 App Engine 标准环境中创建新的 Java 应用。
准备工作
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Cloud Build API.
- Install the Google Cloud CLI.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Cloud Build API.
- Install the Google Cloud CLI.
-
To initialize the gcloud CLI, run the following command:
gcloud init
在 Google Cloud 控制台中为您的 Google Cloud 项目创建 App Engine 应用。
选择您希望应用的计算资源所位于的区域。
- 确保您拥有最新版本的 Cloud Tools for Eclipse。
在 App Engine 标准环境中创建新的 Java 项目
要在 Eclipse 中为 App Engine 标准环境创建新项目,请执行以下操作:
Click the Google Cloud Platform toolbar button .
Select Create New Project > Google App Engine Standard Java Project.
Enter a Project name and (optionally) a Java package.
To create a Maven-based App Engine project, select Create as Maven Project and enter a Maven Group ID and Artifact ID of your choosing to set the coordinates for this project. The Group ID is often the same as the package name, but does not have to be. The Artifact ID is often the same as or similar to the project name, but does not have to be.
Click Next.
Select any libraries you need in the project.
Click Finish.
The wizard generates a native Eclipse project, with a simple servlet, that you can run and deploy from the IDE.
后续步骤
- 创建应用后,您便可以在本地工作站上运行和调试该应用。