The first step of Java learning: JDK environment construction (teach you by hand)

As we all know, when you learn a new language, you always have to build the environment:

Software, plug-ins, various packages...

Especially for Java, there are many students around me who give up the follow-up study because they don’t know how to build a JDK environment-in fact, most of them fail because of fear of trouble, carelessness or handicap, and I can’t find what’s wrong. The result is straight from entry to giving up.

So after many wrong attempts, I came up with a set of JDK installation tutorials suitable for beginners & pure novices . Just follow the installation and do not need to use your own brain.

 

One, JDK download

JDK historical version download:

https://www.oracle.com/cn/java/technologies/oracle-java-archive-downloads.html

Download the latest version of JDK commonly used:

https://www.oracle.com/technetwork/java/javase/downloads/index.htmlwww.oracle.com

It has been updated to JDK15, but generally JDK8 and above can meet the demand.

After selecting Download on the right,

Here you need to check "Accept certificate permission", and then download the corresponding one according to your needs. X86 is a 32-bit computer, and X64 is a 64-bit computer. Be careful not to make a mistake.

 

Two, JDK installation

1. First select the version with the same digits of your computer system (see computer digits: My Computer→Right click→Properties )

I am using the previous JDK8 version here-

2. Start the installation

3. Remember this address and use  C:\Program Files\Java\jdk1.8.0_131 later

 

 

Personally suggest not to modify the installation path, after all, it will not take up much space.

4. Wait

 

5. Little by little

 

6. Keep waiting, wait~

 

7.

 

8. After the 7th step of the installation, enter  java and java -version at the command prompt to produce a bunch of things!

The command prompt opens: Windows + R, enter cmd, click OK

 

Enter java , a bunch of things appear, don’t worry

 

Enter java -version , the version number appears

9. Okay, let's start configuring environment variables

 

New variable name  JAVA_HOME , variable value  C:\Program Files\Java\jdk1.8.0_131

 

Click "OK" to create a new one (QAQ of human nature)

Variable name  CLASSPATH , variable value  .;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar

 

Next modify  Path

 

New, add  %JAVA_HOME%\bin at the end

 

(Or you can add C:\Program Files\Java\jdk1.8.0_131\bin)

The same is true for win7, just add it directly at the back~ But don’t forget to add a semicolon in front  ;%JAVA_HOME%\bin

 

And then continue to click "OK", adding that a total of above  San  Ge, do not mistake ah ~

 

10. Then type javac in the command prompt,  press Enter, and a bunch of things appear again~

 

OK, if you succeed to this step, you're done~~You can start typing code happily!

 

Three, java, java -version display "not an internal or external command"

  1. Spelling mistake

 There is a space in java -version , don't drop it

2. Installation failed, it is recommended to reinstall

 

Four, javac displays "not an internal or external command"

This is the easiest problem for everyone in the configuration environment. If java and java-version have running results, but javac is not here, it means that the jdk installation is successful, but the environment variables are not successfully configured (yes, the installation and configuration are Two different things), after sorting out by myself, I have summarized the following possible errors, which should solve most people's problems:

1. JAVA_HOME is incorrectly configured

JAVA_HOME must be the path when you installed jdk, I haven't changed it, so it is  C:\Program Files\Java\jdk1.8.0_131

If you change it, use your own installation path, which is the address in the box below:

2. After Path  ; %JAVA_HOME%\bin, use  C:\Program Files\Java\jdk1.8.0_131\bin instead

Sometimes the computer may not recognize the relative path (JAVA_HOME), because you need to use its absolute path directly.

3.; Wait for the small punctuation to be knocked out ( just copy the given, try not to enter it manually )

4. No problem with the above, close the command prompt, reopen it and type

5. Restart the computer

 

In short, as long as the JDK environment is set up carefully enough, it can be done directly at one time; if there is a problem, don't panic, see what the error is, and then prescribe the right medicine. The big deal is to reinstall, which is not difficult.

 

At last


If you want to learn Java, I will share some Java learning materials with you. You don’t have to waste time searching everywhere. I have compiled all the materials from Java entry to proficiency. These materials are all made by me. The latest Java learning routes compiled in the year, Java written test questions, Java interview questions, Java zero-based to proficient video courses, Java development tools, Java practice projects, Java e-books, Java study notes, PDF document tutorials, Java programmers’ experience, Java job resume templates, etc. These materials will definitely help you learn Java in the future. It is a must for every Java beginner. Please enter my Java technology qq exchange group to download by yourself . All the materials are in the group. In the file, you need to communicate and learn more with you when you go in.

 

Guess you like

Origin blog.csdn.net/deqing271/article/details/115405147