What is a jdk? What is a JRE? What is the difference between JDK and JRE?
Java Runtime Environment (JRE) contains:
Java virtual machines, library functions, required files for running Java applications and applets
The Java 2 SDK (development Kit) contains:
a superset of the JRE, containing files for program development such as compilers and debuggers
three key features of the Java Runtime environment:
loading code: completed by class loader ;
Checksum code: completed by bytecode verifier ;
execution code: completed by runtime interpreter .
JDK and JRE:
The SDK, or jdk,is a superset of the JRE , with the addition of a compiler and other development tools based on the JRE.
The JRE is the Java Runtime environment, including the JVM and some other java cores API, any computer, You can run java programs only if you have a JRE installed .
Summarize:
1. If you just want to run a JAVA program, you need the JRE . the JRE is usually very small and contains the JVM.
2. If you are developing a JAVA program, you will need to install the JDK.
What is a JVM? (JAVA VIRTUAL machine)
A JVM is a specification that can be implemented using software or hardware, a virtual computer that executes bytecodes bytecode. He also defines the instruction set, register set, structure stack, garbage collection heap, memory area.
The JVM is responsible for running the Java bytecode interpretation and running the side interpretation, so that the speed will be affected. Java provides another way to explain how to run the JIT (just in time), can be explained at once, and then run the machine code on a particular platform, the advanced JIT can only analyze hotspot code, and the code to the local machine code, and the results are cached, the next time directly from memory calls, This greatly improves the efficiency of executing Java code. This enables cross-platform, portable functionality.
1. A JVM is a computer that is emulated by software or hardware on a single computer; it resembles a small, efficient CPU.
2. The Byte-code code is platform independent of the machine instruction of the virtual machine.
3. The Java byte code runs in two ways:
1) mode interpreter (explanation)
2) Just-in-time (Instant compile): There is a code generator that converts the byte code into the machine code of the machine, which can then be executed at a higher speed.
The core of Java's cross-platform implementation is the use of different virtual machines on different platforms
Different operating systems have different virtual machines. the Java virtual machine mechanism masks the difference between the underlying operating platform, enabling "one-time compilation, running Anywhere".
the application scope of the Java language
1. Desktop application Programming
2. Web Client Programming
3. Web Server Programming
4. Mobile programming (J2ME or developing applications on Android today)
5. Robot programming
detailed installation and configuration of the Java development environment
Download JDK
1. where to download the JDK, url:
Http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. JDK7:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
download the different versions according to your own system. If the system is 64-bit, you can download the 64-bit system. How do I see if my operating system is 32-bit or 64-bit?, right-click the desktop computer that appears as shown in the message:
installation Jdk
Other steps are not explained, as with normal software installation, click Next to Ok!
environment variable Configuration
we take the Win7 system as an example, the configuration under XP is basically the same.
1. Right-click on the computer and click Properties:
2. Configure Java_home
Note: Do not add a semicolon, comma-like symbol after the directory value!
3. Configure path
Modifying system environment Variables Path, appended with% Java_home%\bin, and separated by the original path. Add again: ".;". This is meant to indicate the current directory.
Classpath problem: If you use jdk1.5 above you do not need to configure this environment variable! The JRE automatically searches for class files and associated jar files under the current path.
test installation environment for successful installation
run the cmd input command: java–version: The following results are passed and tested.
Enter Javac, and the following results will be passed through the test.
"Java" java_02 environment configuration