Configure the Java learning environment from scratch

To do a good job, he must sharpen his tools.

The same is true for learning programming (Java).

As Java beginners, what development tools should we use?

I say VSCode (Visual Studio Code).

It is recommended that the following conditions be met before this tutorial begins:

  • Try to access the Internet
  • Use Google as much as possible (if not, Microsoft Bing always works…).
  • Have the ability to find answers on the Internet when encountering problems

This article will explain the installation of the following software:

  • JDK 16 (current version)

    The Zulu JDK is used because the author uses the M1 version of MAC

  • VSCode (and necessary extensions)

Also, considering the different operating systems, this article will cover the following systems:

  • Windows 10
  • macOS 11 Big Sur

Windows platform environment construction

JDK 16 installation and configuration

16 the JDK installation

  1. Go to the Zulu JDK website and download the zip package

  2. Once the download is complete, unzip it to a place where you can find it. For example, I unzip it to C:\Develop\jdk16

The JDK configuration

For JDK configuration, there are two main points:

  • JAVA_HOMEEnvironment Variable Configuration
  • PATHEnvironment Variable Configuration
  1. Right click on this computer and click on Properties

  2. Click “Advanced System Settings”

  3. Click “Environment Variables”

  4. Add the JAVA_HOME variable in System Variables and select C:\Develop\jdk16

  5. Add Java content to the PATH variable. As the steps are complicated, please refer to the following GIF

  6. Finally, open CMD and run the Java -version command. If the following information is displayed, the configuration is successful. If the following information is displayed, configure it again.

Visual Studio Code installation and configuration

VSCode installation

  1. Open VSCode’s official website, click the big Download for Windows button, and wait patiently for the Download to complete.

  2. After downloading, open the installation package.

  3. Select “I agree to this agreement” and click “Next”

  4. The default installation path is recommended. Click “Next”.

  5. Start menu default, click “Next”

  6. Additional tasks recommended to select all, click “Next”

  7. Click “Install”

  8. Wait patiently for the installation to complete

  9. Run VSCode to install the extension

Extend the installation

  1. Chinese plug-in Installation

  2. Java Plug-in Installation

  3. Code Runner installation

Build macOS platform environment

16 the JDK installation

  1. Download the JDK, the address is above

  2. Once the download is complete, unzip it to a location where you can find it. For example, I unzip it to ~/Develop/jdk16

  3. Open the user profile (such as ~/.bash_profile or ~/.zprofile) and add the following at the bottom (where XXX is the user name) :

    JAVA_HOME=/Users/xxx/Develop/jdk16/zulu-16.jdk/Contents/Home
    PATH=$JAVA_HOME/bin:$PATH:.
    export JAVA_HOME
    export PATH
    Copy the code
  4. Restart the terminal and enter Java -version. If the following information is displayed, the configuration is successful. Otherwise, configure it again.

    Openjdk Runtime Environment Zulu16.30+15-CA (build 16.0.1+9) OpenJDK 64-bit Server VM Zulu16.30+15-CA (build 16.0.1+9, mixed mode)Copy the code

VSCode installation

Download the installation package from the official website and drag it to the application

As for expansion?? Just scroll up Windows… I don’t have to repeat it.