I. java Overview:, java Overview:
In 1991, Sun's James Gosling and others began to develop the language named Oak, hoping to control the microprocessor embedded in the cable TV switching box and PDA;
In 1994, the Oak language was renamed to Java;
JavaThree technical architectures:
JAVAEE:Java Platform Enterprise Edition is used to develop applications in an Enterprise environment, mainly for web application development;
JAVASE:Java Platform Standard Edition is the basis for developing desktop applications;
JAVAME:Java Platform Micro Edition: Develop Electronic consumption products and embedded devices, such as programs in mobile phones;
1,JDK:Java Development Kit,Java Development and running environment, java development tools and jre.
2,JRE:Java Runtime Environment,The runtime environment of the java program, the class library required for java running + JVM (java Virtual Machine ).
3, Configure environment variables:The tool in the java jdk \ bin directory can be run in any directory because the directory where the tool is located is told to the system. When the tool is used, the system will help us find the specified directory.
Environment Variable Configuration:
1):Permanent configuration: JAVA_HOME = % installation path % \ Java \ jdk
Path = % JAVA_HOME % \ bin
2):Temporary configuration: set path = % path %; C: \ Program Files \ Java \ jdk \ bin
Features: by default, the system first finds the program to be executed in the current path. If not, it finds the program in the path set in path.
ClasspathConfiguration:
1):Permanent configuration method: classpath =.; c: \; e :\
2):Temporary configuration method: set classpath =.; c: \; e :\
Note:Notes when defining the classpath Environment Variables
If the environment variable classpath is not defined, after java starts jvm, it will find the class file to be run in the current directory;
If classpath is specified, the class file to be run is located in the specified directory.
Will it be found in the current directory? Two cases:
1):If a semicolon exists at the end of the classpath value and no running class is found in the specific path, a new class will be found in the current directory by default.
2):If no semicolon exists in the value of classpath, the running class is not found in the specific path, and the class is not found in the current directory.
Generally, the semicolon is not specified. If the class file to be run is not found in the specified directory, an error is returned, which allows you to debug the program.
4,JavacCommands andJavaWhat do commands do?
Java is divided into two parts: Compilation and running.
Javac:It is responsible for the compilation part. When javac is executed, the java compiler program will be started. Compile the. java file with the specified extension. Generates bytecode files that can be recognized by jvm. That is, the class file, that is, the java running program.
Java:The running part will start jvm. Load the class library required for running and execute the class file.
To execute a file, there must be a starting point for execution, which is the main function.