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
-
Go to the Zulu JDK website and download the zip package
-
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_HOME
Environment Variable ConfigurationPATH
Environment Variable Configuration
-
Right click on this computer and click on Properties
-
Click “Advanced System Settings”
-
Click “Environment Variables”
-
Add the JAVA_HOME variable in System Variables and select C:\Develop\jdk16
-
Add Java content to the PATH variable. As the steps are complicated, please refer to the following GIF
-
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
-
Open VSCode’s official website, click the big Download for Windows button, and wait patiently for the Download to complete.
-
After downloading, open the installation package.
-
Select “I agree to this agreement” and click “Next”
-
The default installation path is recommended. Click “Next”.
-
Start menu default, click “Next”
-
Additional tasks recommended to select all, click “Next”
-
Click “Install”
-
Wait patiently for the installation to complete
-
Run VSCode to install the extension
Extend the installation
-
Chinese plug-in Installation
-
Java Plug-in Installation
-
Code Runner installation
Build macOS platform environment
16 the JDK installation
-
Download the JDK, the address is above
-
Once the download is complete, unzip it to a location where you can find it. For example, I unzip it to ~/Develop/jdk16
-
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
-
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.