One: Java Overview:
In 1991, Sun's James Gosling and others began to develop a language named Oak, hoping to control microprocessors embedded in cable-switched boxes and PDAs;
1994 renamed the Oak Language to Java;
Java Three technical architectures:
java EE : Java Platform Enterprise Edition, the development of applications in the corporate environment, mainly for the development of web programs;
Javase : Java Platform Standard Edition, the completion of desktop application development, is the basis of the other two;
Javame : Java Platform Micro Edition, the development of electronic consumer products and embedded devices, such as mobile phone programs;
1 , Jdk:java Development Kit,Java Development and runtime Environment, Java development tools and JRE.
2 , Jre:java Runtime Environment,Java program run environment, Java run the required class library +JVM (Java Virtual machine).
3 , configure the environment variable: Let the Java jdk\bin Directory tool, can run in any directory, because the tool is located in the directory to tell the system, when using the tool, the system helps us to find the specified directory.
Configuration of environment variables:
1): permanent configuration mode: java_home=% installation path%\JAVA\JDK
Path=%java_home%\bin
2): Temporary configuration mode: Set path=%path%; C:\Program Files\java\jdk\bin
Features: The system defaults to the current path to find the program to execute, if not, then go to the path set in the paths to find.
Classpath the configuration:
1): permanent configuration mode: classpath=.; C:\;e:\
2): Temporary configuration mode: Set classpath=.; C:\;e:\
Note: when defining CLASSPATH environment variables, you need to be aware of the situation
If you do not define an environment variable Classpath,java starts the JVM, it looks for the class file to run under the current directory;
If Classpath is specified, the class file to be run is looked up under the specified directory.
Will you find it in the current directory? Two cases:
1): If there is a semicolon at the end of the Classpath value, the running class is not found in the specific path, and will be found again by default in the current directory.
2): If the value of classpath results in no semicolon, the running class is not found in the specific path and is no longer found in the current directory.
Generally do not specify a semicolon, if not found in the specified directory to run the class file, the error, so you can debug the program.
4 , what does the Javac command and the Java command do?
You know that Java is divided into two parts: one is compile, one is run.
Javac : responsible for the compiled part, when executing Javac, the Java compiler program is started. Compiles a. java file with the specified extension. Generates bytecode files that the JVM can recognize. This is the class file, which is Java's running program.
Java : The part that is responsible for running. The JVM is started. Loads the class library that is required by the runtime and executes it on a class file.
A file to be executed must have a starting point for execution, and this starting point is the main function.
Java Basics of Java tutorials