Java installation and configuration overview

A, Java popular reasons

1, the outbreak of the Internet

2, solve the compatibility issues of hardware and software

Java core strengths - Cross-platform

Two, Java version

1, JavaSE: java standard edition, a desktop surface-side development.

2, JavaEE: java Enterprise Edition, for server-side development.

3, JavaME: java computer, an embedded development.

Three, Java cross-platform

Because different operating systems management hardware. jvm java program by manipulating the operating system hardware work to mobilize, thus smoothing the difference between each platform (win / unix / linux), where java source code (* .java) formed after compiled bytecode (* .class) , bytecodes can be executed directly JVM. If you want each platform can execute an application, you need to install jvm corresponding platform in each platform.

jvm is a specification of a virtual dedicated computer for executing bytecode bytecode, jvm may be realized by way of hardware, it may be realized by way of software. The principle of cross-platform Java determines its performance without high C / C ++.

Four, the JDK installation configuration

To version jdk-8u161-windows-x64, for example,

1. Check your computer OS bit (x64 / x86), create jdk installation directory D: /java/jdk_1.8.161+jre_1.8.161

2, jdk installation jdk_1.8.161 file in the previous step to create the folder, jre installed jre_1.8.161 file folder you created in the previous step

3, environment configuration, the computer -> Right Properties -> Advanced System Settings

  (1) Create a system variable JAVA_HOME, variable value: D: \ java \ jdk_1.8.161 (inform third parties rely on jvm software platform jdk installation location).

  (2) Edit System Variable Path, added to the beginning (remember the semicolon at the end): D: \ java \ jdk_1.8.161 \ bin; (inform the terminal where to find commands entered by the user).

  (3) classpath, 1.5 or later JDK, do not set the classpath environment variable. JDK will automatically search for class files in the current directory, and the use of Java compiler and runtime tools, the system can automatically load dt.jar (a library on the operating environment, mainly swing package) and tools.jar (about Java class libraries Some tools) file. Prior to version 1.5 will configuration, this configuration represents the current path in front of it, the other is to add dt.jar and tools.jar two files to the classpath environment variable:;. D: \ java \ jdkxxx \ lib \ dt. jar; D: \ Java \ jdkxxx \ lib \ tools.jar;

Five, the Java security

1, the language level of security is mainly reflected in:

  1) Java cancel a powerful but dangerous hands, and replaced by reference.

  2) garbage collection: automatically by the garbage collector reclaims the memory is no longer used in the background. Avoid forget the timely recovery program, resulting in a memory leak. Avoid program error recovery procedures core libraries of memory, causing a system crash.

  3) exception handling mechanism: Java exception mechanism depends on the try, catch, finally, throw, throws five keywords.

  4) cast: Only in the case of forced conversion rules in order to meet the strong turn succeed.

2, the underlying security:

  1) Java uses a public key encryption scheme (PKC) during the transfer byte code.

  2) in the execution environment provides four security protection mechanism:  bytecode verifier - class loader - Runtime memory layout - file access restrictions

Six Relations, JVM, JRE, JDK's

1, JVM: Java Virtual Machine, which is the core part of the whole cross-platform java, java program will first be compiled into .class class files, which can be performed on jvm, by the virtual machine to explain the program operating system.

2, JRE: java runtime environment, the light has not let JVM class file is executed, as explained in class when JVM need to call the library lib explanation needed. In JDK installation directory where you can find jre directory, there are two folders bin and lib, where you can think of is in the bin jvm, jvm lib is in the library needed for the work, and while jvm lib and up He called jre. Java program must also JRE to run. 

3, JDK: java Development Kit, JDK installation directory the following six folders that really works when you run java following four folders:

  bin (most notably compiler (javac.exe))

  include (header files and java to interact with the JVM)

  lib (library)

  jre (java runtime environment)

Therefore, JDK includes JRE, and JRE included JVM.

Guess you like

Origin www.cnblogs.com/javasan/p/11311367.html