Java learning notes (entry) _ installation and configuration of java, learning notes _ java
I have been learning Java for a long time, but I always feel that the foundation is not very good. Sometimes I cannot start with some common problems, and some of my problems are also displayed. Therefore, I plan to write Java notes to consolidate the foundation and enhance learning. Today is the first article, mainly about java installation and configuration, which is often referred to as "Hello world.
1. Download
Go to the official Oracle website and download the Java jdk,
Ii. Installation
The installation is simple. You only need to perform the next step. You can select the path as needed.
Iii. Configuration
After jdk is installed, you cannot compile the program because you need to configure the java jdk. Choose System Properties> advanced> environment variables> system variables. Then add the path and classpath variables,
Path:D: \ Program Files \ Java \ jdk1.7.0 _ 07 \ bin)
Classpath:.; D: \ Program Files \ Java \ jdk1.7.0 _ 07 \ lib \ tools. jar; D: \ Program Files \ Java \ jdk1.7.0 _ 07 \ lib \ dt. jar (there is no semicolon at the end)
Taking Windows 7 as an example, we can see the following figure:
-
Iv. Test
After the configuration is installed, you can test whether the installation is successful. Go to cmd and run the "javac" command. If the following command is displayed, the installation is successful. Otherwise, the installation is incorrect and you need to reinstall it.
So that java is installed and configured, and the next step is to use it to write programs.