Java learning is usually started with J2SE. So we have to install the environment before development, the installation environment there is any need to pay attention to the problem?
First we're going to download the JDK we need and install it under the directory we want to put.
(1) Path variable. The JDK includes compilers (javac.exe) and interpreters (Java.exe), which are all under the bin directory of the JDK installation directory, and if we want to compile Java files and interpret bytecode in any directory on our own computer, we will configure the path variable. Enter the advanced variable from my computer and add the bin address to the path variable (create a new one without the path variable).
(2) Classpath variable. In general, if we do not have Java-related commercial software installed, this variable can be configured or not configured. Reasons to configure: The Jre\lib\rt.jar in the JDK directory is a class library that is used by Java, if it is not configured, it may be wrong to debug other commercial software. The configuration method is to enter advanced variables through my computer and add the following form (new classpath variable without classpath):
JDK directory \jre\lib\rt.jar;.;
Then we can develop, so what is the process of development that needs attention?
Write the source file in Notepad, when there are several different classes in the source file, there can be at most one class with the keyword public, The source file name is consistent with the class name that contains the public and is suffixed. java. If none of the classes have public, the source file is named the same as any of the class names and is suffixed.
The class that contains public static void main (String args[]) {} is called the main class, and the main method is where the program begins execution.
The above is my personal learning experience, if there are errors, please correct me.
Issues to be aware of when installing the Java Development Environment JDK and the development Process (Window System)