Jdk8 installation and configuration tutorial for Java novice environment
Recently, I have time to write some very simple and basic things, mainly at the operational level. The main considerations are as follows: 1. Often build a development environment, so it is necessary to record it and you can check it yourself; 2. For beginners, write some of the simplest and most practical things.
1. Confirm that Java has not been installed
First, confirm that Java is not installed on our computer. Open the command line and enter Java - version. The following display shows that Java has not been installed.
2. If you haven't installed Java, go to the official website to download the latest version of Java
Next, download the latest version of Java from the Oracle website. Baidu search keyword "oradle Java" can be easily found. It is not recommended to directly use other people's downloaded software or download it from a third-party website. It is only recommended to download these open-source software from the official website.
The following are the main steps, incomplete and not unique. You don't have to follow my steps very strictly.
You must select "accept license agreement" here to allow downloading. I wrote "jdk-8u45-windows-x64. Exe".
3. After downloading, click Install
Then it is the next step, the next installation. Note: it is recommended that the path to install the software do not contain Chinese, spaces and special characters. Don't put the software in a deep path. If it is a Windows operating system, don't put the software on Disk C (because if the system is reinstalled, these software will disappear. Some software, such as Java, can be reinstalled without configuring environment variables and path).
I am used to creating a new folder under the drive letter of non-C drive, such as "D: \ app" as the directory for all my installation and development software. Of course, it's called "dev" or "tools". I think it's a good choice.
Then there's the next step, the next step.
The following configuration is critical.
4. Configure Java_ Home and path environment variables
After installation, the directory is like this.
Note: we don't need to do the above steps in the future, even if you package and copy these files to another computer and configure Java_ Both home and path computers can be used.
Right click "my computer" and click properties
Select advanced system settings
On the Advanced tab, click environment variables
Create a new item in the user variable of "Administrator", and the variable name is Java_ Home, the variable value is the home directory of the Java software just installed
For example:
Create a new item in the user variable of "Administrator", the variable name is path, and the variable value is as follows
Variable name: Path
Variable value:% Java_ HOME%\bin;
Surrounded by "%" is a variable, which refers to the variable name Java in the previous step_ Home actually points to the home directory of the Java installation files.
In this way, the separation of variables is completed to facilitate our modification in the future. If you want to change the Java installation directory, first move the installation directory, and then modify Java_ Change home to the installation directory on the corresponding computer. Many of our software is installed like this. Is it very green?
Key points: the significance of configuring the path environment variable
When we enter Java related commands in the CMD command window, our operating system will find Java programs in the current path by default, that is, when we run the Java - version command, we actually run the programs marked in the following figure:
But many times
1. We want to compile a java source code. We can't locate CMD to the bin directory of Java software installation every time, which increases the complexity of compiling the source code;
2. Many software needs the support of Java software to run, such as tomcat, ant, maven, gradle, development tools eclipse and IntelliJ idea. How can they feel that Java programs are installed on our computer.
Therefore, we need to configure path, which is specified by the operating system:
1. When running the program, in addition to finding the program in the current directory, return to the path pointed to by the environment variable path. If you can find it, it can run smoothly. Path can set multiple paths separated by English semicolons;
2. Tomcat, ant, maven, gradle, development tools eclipse and IntelliJ idea will also go to the path pointed to by the environment variable path to find whether there is Java. If so, they will feel that Java software is installed on the machine.
Verify that the installation was successful
Here, the Java software will be installed, and we will enter it in the CMD window
As shown in the figure below, Java installation is successful.
antic
Press and hold the shift key with the left hand and the right mouse button to see "open command window here", which can quickly locate the CMD window under the specified directory.
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.