All Products
Search
Document Center

Alibaba Cloud SDK:Build a Java development environment on Windows

Last Updated:Jun 28, 2024

This topic describes how to build a Java development environment on Windows. In this example, IntelliJ IDEA is used.

What is a Java development environment?

A Java development environment is a collection of configurations and tools that are used to develop Java projects. It includes the Java Development Kit (JDK), an integrated development environment (IDE), such as IntelliJ IDEA, Eclipse, and VSCode, and build tools, such as Maven.

Install the JDK

For more information, see Install the JDK on Windows.

Install an IDE

In this example, IntelliJ IDEA Community is installed. To download IntelliJ IDEA Community, go to the download page of IntelliJ IDEA Community and click Download. After you download IntelliJ IDEA Community, install it as prompted.

image

Important

When you install IntelliJ IDEA Community, select Add "bin" folder to the PATH in the Installation Options step. In other steps, click Next.

Create a Maven project

  1. Open IntelliJ IDEA and click New Project.

    IntelliJ IDEA is an JDE that provides comprehensive features and allows you to compile, test, build, run, and deploy a project. The IDE facilitates developers to effectively manage and maintain their software applications.

    image

  2. In the left-side navigation pane of the New Project window, click Java and configure the following parameters in the right-side section.

    Name: The name of the project. In this example, helloaliyun is entered.

    Location: The path of the project file.

    Build system: The type of the project. If you select Maven, a Maven project is created.

    JDK: The JDK version. In this example, JDK 8 is selected.

    Note

    To select a JDK, click Add JDK, select the JDK that is installed, and then select the directory where the JDK is installed.

    Add sample code: Specifies whether to add sample code. If you select the field, a Main class is created.

    image

  3. Click Create.

    Then, a project named helloaliyun is created. The project contains a pom.xml file, a src/main/java directory, and a Main class.

    image

  4. Check whether the Java development environment is built.

    In the src/main/java directory of the project, find the Main class in the org.example package, double-click the class name to open the file, and then click the Run icon in the upper-right corner.

    image

    Check whether an output of Hello World! is displayed in the console. If the output is displayed, the Java development environment is built on Windows.

    image