Home >Java >Javagetting Started >How to install java environment
How to install the environment for java?
First, search java jdk on Baidu, find a website that meets the conditions, and download it. Because Oralce is a foreign website, although the products released are new, the download is slow. You can download it from a domestic download site. .
Recommended tutorial: "java learning"
After the download is completed, you will see the classic Java installation tool. The icon looks like a cup of coffee.
Double-click this program to install it. By default, just keep "Next". It will be installed on the C drive by default. This development package was installed very quickly.
The highlight is here. If you stop here, the system will not recognize the Java you have installed. It will be the same as if it is not installed. You need to right-click your mouse to open My Computer and find "Properties".
After opening the properties, find "Advanced", find the "Environment Variables" below and open it.
In the environment variables, there are two places to modify. One is to add JAVA_HOME. You can choose "New", fill in JAVA_HOME for the variable name, and fill in C:\Program Files\Java\jdk1.7.0_04 for the variable value. Because during the above installation process, I defaulted to the next step to install, so I installed it on the C drive. If you changed it during the installation process, it may be the D drive or E drive. The same variable values need to be changed accordingly.
There is one more place to modify, which is Path. Add the JAVA variable value to Path, select Path, then click "Edit" and add the following statement at the end;% JAVA_HOME%\bin;
Okay, the environment variables have been set, just click OK. Now let’s test to see if it really works. Open the DOS window, go to “Start” in the lower left corner, enter “CMD” in “Run”, open the DOS window, enter the command java -version and press Enter.
OK, the system found our java version, which turned out to be version 1.7.0_05.
In this way, our computer supports Java programs to run on the computer, and further development work can be done on it, and then compiled in DOS.
The above is the detailed content of How to install java environment. For more information, please follow other related articles on the PHP Chinese website!