- Programming languages are divided into: compiled and interpreted languages.
- A compiled language requires a one-time compilation by a specific compiler to become a machine code executable for that particular platform's hardware, running independently from the development environment, running efficiently, but not being ported across platforms.
- An interpreted language requires a language that is interpreted by a particular interpreter on a per-line basis into the machine code of a particular platform and executed immediately. It is not possible to run independently from the interpreter, run inefficiently, and be easy to cross-platform, just provide an interpreter for a specific platform.
- the Java language is both a compiled and interpreted language. The execution of a Java program must be compiled first and then interpreted in two steps. the Java source program compiles a platform-independent bytecode (*.class file) that is not executable and requires a Java interpreter to interpret execution. The Java language is responsible for interpreting the execution of bytecode files (*.class) in the JVM.
- *.class bytecode is not intended for any platform, only for the JVM. The JVM on all platforms is different, but they all provide the same programming interface to the compiler, so as long as the corresponding JVM is implemented for different platforms, the compiled Java bytecode can be run on the platform, thus realizing the cross-platform .
- windows looks for commands through the PATH environment variable, Windows case insensitive, path and path are not different; Linux looks for commands through the PATH environment variable. Linux is case sensitive and must be set to path . a semicolon (;) is used as a delimiter between multiple paths on the Windows platform,%PATH% to refer to the original path, while Linux uses a colon (:) as the delimiter $PATH to refer to the original path.
- when you set the PATH environment variable, system variables are ranked before the user variable, If you find the path in the system variable, you are no longer looking for the user variable.
- 1.5 later versions of JDK,JRE automatically search for class files under the current path, and when using Java to compile and run tools, the system can automatically load Java classes in Dt.jar and Tools.jar files . so you no longer need to set the CLASSPATH environment variable .
- JDK1.5 the CLASSPATH environment variable can also be set, once the CLASSPATH,JRE is set, the Java class will be searched under the path specified by the environment variable. This means that the classpath path does not contain (.), that is, does not contain the current path, and the JRE does not search the current path for Java classes.
Java Learning Notes (a) Introduction to Java