environment variable

If path
executes a file in the operating system, the system will look for the file in the current directory, and if it cannot find it, it will look for the file in the path directory.
What is classpath
Classpath is similar to path, but classpath is the configuration of looking for .class files in environment variables, and path is looking for .exe executable files.
Configuring classpath is to input the directory where you save the .class class file into the classpath static variable, so that you can use the java virtual machine to run the .class class file in the environment variable directory in any directory.
One thing to note is that the path environment variable first looks for the .exe executable file in the current working directory, while the classpath environment variable first looks for the .class class file in the environment variable directory, and then looks for the current directory.
If the classpath environment variable can be written to find the class file in the current directory, there will be a situation where different class files are run, that is, the class file that is not run is not the one you want to run. Therefore, the general classpath environment variable should not point to the current working directory.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326614949&siteId=291194637