If you want to learn JAVA, you must install JDK (Java Development Kit) and configure the environment variables before you can learn Java. After several failed attempts to configure the environment variables, I finally succeeded. This blog post is formed by summarizing the problems encountered. Welcome to communicate. [Of course, I’m a newbie.] 】Common reasons for failure are as follows:
1. Download JDK (take jdk1.8.0 as an example) You can download it directly from CSDN. I have personally tested the following resources and found them to be effective. After the download is complete, it will be an installation program. 2. Install JDK (do not use next without thinking)When the installation program is in progress, first install the jdk (default path: C:\Program Files(x86)\Java\jdk1.8.0-60\) and then install the jre (default path: C:\Program Files(x86)\Java\jre1.8.0-60\). We don’t like to install so many software on the C drive. When we customize the installation, if they are all installed in one folder, the later installed jre will overwrite the original files. That is to say, jre must be installed in another folder. Check method: Open the directory where JDK is installed, search for javac.exe in the bin folder, if it is not there, it has been overwritten. When I check the installation at the end, both java -version and java commands can be executed, but javac command will show: javac shows "not an internal or external command. My suggestion is: before installation, create a java folder in the target disk, and create two folders, jdk and jre, under this folder, and install them respectively. At this point, JDK has been installed correctly. 3. Configure JDK environment variablesRight-click This PC, click Properties, and then click Advanced system settings. Create a new system variable JAVA_HOME (write directly) Create a new system variable CLASSPATH (write directly) Variable value: (Don't lose the first one!!!) (Strictly copy)
Adding a dot means that you can run Java in any directory. Edit the system variable Path (add two values) Many installation tutorials write %java_home% here, but the Path under the win10 system does not support %java_home%, which represents the value of the java_home environment variable and is a reference. But the absolute path must be used here in win10. At this point, you have completed the configuration of environment variables. Normally, you have succeeded. Let's check it below. 4. Check whether the environment variables are correctPress WIN+R, enter cmd, enter the command line interface, and perform three checks. java -version check enter:
2. Java inspection
3. Javac check
At this point, you have completed the JDK installation! If other errors are found, you can check whether the Chinese and English formats, uppercase and lowercase letters, and paths are correct. V. Other Notes1. User variables and system variables There are two locations for setting environment variables, one is user variables and the other is system variables. User variables are only useful to the user, and system variables are useful to the system. If there are two users on your computer, setting it in user variables is only useful for the current user, while setting it in system variables is useful for both users. Generally, it is set in the system variable location. 2.java and javac javac: is a compilation command that compiles Java source files into .class bytecode files. Summarize This is the end of this article about the process of JDK installation and configuration of environment variables under WIN10 (detailed version). For more relevant content about configuring JDK environment variables under WIN10, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Solution to leaving gaps between BootStrap grids
>>: Use Grafana+Prometheus to monitor MySQL service performance
1. Pull the image First, execute the following co...
Background of the accident: A few days ago, due t...
React project building can be very simple, but if...
At the end of last year, I replaced the opensuse ...
Start cleaning carefully! List unused volumes doc...
Add a DOCTYPE to the page Since different browser...
Copy code The code is as follows: <span style=...
This article shares the specific code of js canva...
CSS plays a very important role in a web page. Wi...
environment Hostname IP address Serve Prometheus ...
(I) Basic concepts of web page color matching (1) ...
Adding background image control to a component re...
Table of contents Slow query basics: optimizing d...
Table of contents 1. Introduction 2. MVCC (Multi-...
CentOS6.9+Mysql5.7.18 source code installation, t...