window system installation java
Download JDK
First we need to download the java development tool kit JDK, download address: http://www.oracle .com/technetwork/java/javase/downloads/index.html, click the download button as follows:
In the download page, you need to choose to accept the license and adjust it according to your system Select the corresponding version. This article takes the Window 64-bit system as an example:
After downloading, install the JDK according to the prompts. When installing the JDK, the JRE will also be installed. and install it.
Install JDK. During the installation process, you can customize the installation directory and other information. For example, we choose the installation directory as C:\Program Files (x86)\Java\jdk1.8.0_91.
Configure environment variables
1. After the installation is complete, right-click "My Computer", click "Properties", and select "Advanced System Settings";
2. Select the "Advanced" tab and click "Environment Variables";
Then the following will appear: Screen:
Set 3 properties in "System Variables", JAVA_HOME, PATH, CLASSPATH (case does not matter), if it already exists, click "Edit", no If it exists, click "New".
Note: If you use JDK version 1.5 or above, you can compile and run Java programs normally without setting the CLASSPATH environment variable.
The variable setting parameters are as follows:
Variable name: JAVA_HOME
Variable value: C: \Program Files (x86)\Java\jdk1.8.0_91 // Configure according to your actual path
Variable name: CLASSPATH
Variable value: .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar; //Remember there is a "." in front
Variable name: Path
Variable value: %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
JAVA_HOME Settings
##PATH Settings
CLASSPATH setting
This is the Java environment configuration. After the configuration is completed, you can start Eclipse to write code and it will automatically Complete the configuration of the java environment.Test whether the JDK is installed successfully
1. "Start"->"Run", type "cmd";2. Type the command : java -version, java, javac several commands, the following information appears, indicating that the environment variable configuration is successful;Linux, UNIX, Solaris, FreeBSD environment variable settings
The environment variable PATH should be set to point to the location where the Java binaries are installed. If you have trouble setting up, please refer to the shell documentation. For example, assuming you are using bash as your shell, you can add the following to the end of your .bashrc file: export PATH=/path/to/java:$PATHMore For java knowledge, please pay attention tojava basic tutorial.
The above is the detailed content of How to configure java. For more information, please follow other related articles on the PHP Chinese website!