1.Java programs are written in the form of classes.
2. The file that holds the source code is called the source file. (the computer can not directly understand, need to compile, the computer can understand)
How do I compile my source files?
With the Javac command.
The compilation of the 123 Java program is achieved by entering "Javac 123.Java". (If you want to operate in the directory of this source file)
A class file (a computer-readable file) is generated when the compilation is complete
class files need to be executed through Java commands
Note: If you precede the class with public, the name of your source and class files must be the same.
Configure your own path to this class file so that it can be executed in any directory.
Method One: Temporary configuration
Set classpath= the path to your class file
(Note: If the set classpath= behind nothing, then it is to empty the classpath, if there are multiple classpath need to find, separated by semicolons, but the end of the last item do not add a semicolon, example: Set classpath=c:/; J:/java This system will look for the C packing directory, and then go to the J Disk Java; Why not add a semicolon at the end? Because if a semicolon is added, it will be checked in your current directory again, if you want to first find the current directory, you can do this with set classpath=. c:/; J:/java)
Method Two: Permanent configuration
To the computer right-click Properties of the environment variable to create a new classpath.
Java Learning-Basic knowledge