1. The principle of the Java language cross-platform
First what is the platform, the platform is the CPU processor and the overall operating system. If the computer is human, then the CPU is the human brain, it is responsible for the thinking of computing, but also responsible for the body parts of the command control. There are many kinds of CPUs,
In addition to our well-known Intel and AMD, there are, for example, Sun's SPARC, such as IBM's PowerPC and so on, that each company produces CPU usage or the same or different instruction sets. An instruction set is a set of instructions that the CPU uses to compute and control a computer system.
The system is the interface software that acts as the interaction between the user and the computer, the different operating systems support different CPUs, and the different operating systems support different CPU instruction sets in a strict sense. The Windows,liunx,mac,solaris now supports both Intel and AMD's CPU instruction set.
Know what is platform after we come to understand how Java cross-platform?
Java is interpreted to execute, compiled into the intermediate code of the compiler is independent of the platform, the intermediate code generated by the compiler is also independent of the platform (once compiled, run everywhere), the intermediate code is interpreted by the interpreter execution, the interpreter is platform-related, that is, different platforms need different interpreters.
Java is first compiled and then explained
The same. class file gets different machine instructions (different from Windows and Linux machine instructions) at different virtual opportunities, but the result is the same for the final execution.
2. JRE and JDK Overview
JRE: Includes Java virtual machines (JVM Java) and the core class libraries required by Java programs, and so on, if you want to run a well-developed Java program, you only need to install the JRE on your computer. jre:jvm+ class Library.
JDK:JDK is available to Java developers, and includes Java development tools and JRE. So with the JDK installed, you don't have to install the JRE separately.
One of the development tools: the Compilation tool (Javac.exe) packaging Tool (Jar.exe) and so on. Development tools for Jdk:jre+java.
Why does the JDK include a JRE: A program that has been developed and needs to run to see the effect.
3. What is the relationship between JRE, JDK, and JVM?
4. Directory interpretation under JDK installation path
A:bin directory: This directory is used to store some executable programs.
such as Javac.exe (Java compiler), Java.exe (Java Runtime Tool), Jar.exe (Packaging tool) and * Javadoc.exe (document Generation tool), etc.
B:DB directory: The DB directory is a small database.
Starting with JDK 6.0, a new member, JAVADB, is referenced in Java, a pure Java implementation, open source database management system. This database is not only lightweight, but also supports all JDBC 4.0 specifications, when learning jdbc, no more need to install a database software, choose to use JAVADB directly.
C:jre directory: "JRE" is the abbreviation for Java Runtime environment, meaning Java Program Runtime environment. This directory is the root of the Java Runtime Environment, which includes Java virtual machines, runtime class packages, Java application initiators, and a bin directory, but does not include development tools in the development environment.
D:include directory: Because the JDK is implemented through C and C + +, you need to introduce some C-language header files at startup, which is used to store these header files.
E:lib Directory: LIB is the abbreviation for the library, meaning the Java class library or library file, which is the archive package file used by the development tool.
F:src.zip file: Src.zip is a compressed file for the SRC folder, and the source code for the JDK core class is placed in SRC, which allows you to view the source code of the Java base class.
How is Java implemented across platforms?