Teach you the installation and environment configuration of JDK+IDEA

                

Table of contents

1. Install JDK first 

1.1 Check the number of computer systems

1.2 Install the same JDK as the computer system

 2. Configure the environment for JDK

2.1 Configure the jDK environment in three steps

2.2 Check whether the JDK environment configuration is good

3. Install IDEA

3.1 Download the installation package

3.2 Install JDEA installation package

4. Create a project on IDEA


Because the system has just been reinstalled, JDK and IDEA are gone, so just during the installation process, I published a blog about installation and environment configuration, so that those who don’t know how to install can take a look.

1. Install JDK first 

1.1 Check the number of computer systems

Before installing JDK, you must first know whether your computer is 32-bit or 64-bit, follow this step to view

Find the computer file explorer (win11)

Because my computer is 64-bit, I need to install 64-bit JDK

1.2 Install the same JDK as the computer system

What version of JDK to install?

Now the JDK version update may be very high, but the company may only use 1.7 or 1.8, so we don't need to download the latest version, the 1.8 version is enough.

 download jdk

I will directly provide you with a jdk1.8 here, or you can go to the official website to download it

Link: https://pan.baidu.com/s/1BDr6Yd1m0jfkUcJAI7pTFw 
Extraction code: nvie

First, go to the Oracle website to obtain the JDK installation package. The JDK installation package is integrated in Java SE, so just download Java SE

Oracle网站:Oracle | Cloud Applications and Cloud Platform

 After entering the website Oracle, click on the product

 find java open

Click Download Java to enter the Java download page

 Choose how many bits of jdk your own computer corresponds to, and download it

Start the installation below. After the download is complete, just click on it.

click next

 

If you do not modify the installation path, click Next

Click OK, then click Next to install the JDK


 2. Configure the environment for JDK

2.1 Configure the jDK environment in three steps

 The first step is to find the environment variables in the computer

 The second step is to configure environment variables for JDK (in three steps)

(1) Configure JAVA_HOMEthe environment variable, the value is the installation directory of JDK . Why do you need to configure it like this, mainly because many open source software depends on this variable, which is used to find the Java environment on the machine, for example: tomcat is used in Javaweb, 

(2) For configuration Path, it should be noted Paththat the path generally exists, and only needs to be added. The meaning used here is to directly refer to the value %JAVA_HOME%configured aboveJAVA_HOME . The advantage of this is that if the Java installation directory changes, only JAVA_HOMEthe value needs to be modified, and there is no need to modify Paththe value of the variable.

 Write this %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin; in front of it and add a semicolon after it, and then click OK

Under normal circumstances, win10 removes the semicolon and interlaces 

But it is also possible that the %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin; configuration will fail after restarting  . The solution is to put the full path of the JDK in, such as D:\Program Files\Java\jdk1. 8.0_192\bin

 (3) Configure the CLASSPATH environment variable,

The variable value is .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar

This variable value can be copied directly

Create a new CLASSPATH environment variable

 Then click OK to configure

After completing the above three-step JDK environment configuration, the JDK is configured

2.2 Check whether the JDK environment configuration is good

The first step is to open the command window by win+R and enter cmd to open

 Then enter java -version to open the JDK

 Then enter javac

 If you can open the instructions normally here, your JDK has been installed

If you run into problems like

 Or if there is a problem in the first step, it is because the environment is not configured properly, so check it again.

If you really have a problem, you can take a look at this friend's blog, and it will definitely solve your problem

After the JDK is installed, if you encounter problems, click me 



3. Install IDEA

3.1 Download the installation package

We first open the IDEA official website

链接    Download IntelliJ IDEA: The Capable & Ergonomic Java IDE by JetBrains

The above one is in English, and this one is in Chinese (you can click this if you don’t understand English)

IntelliJ IDEA: JetBrains' Powerful, Ergonomic Java IDE

 click and download

3.2 Install JDEA installation package

Double-click to open the installation package, click next

 Because I want to put it on the D drive, I created a folder on the D drive to put IDEA

After selection, click OK, click next

continue next

 Then click Install to start the installation. After installation, click Finish


4. Create a project on IDEA

After installation, double-click to open, follow the steps below

  

 Once created, enter the project

Then in src create like this

 

 give a name

Then you can start writing code

 Click this to run the code


Guess you like

Origin blog.csdn.net/m0_58761900/article/details/124544372