"Deep J2SDK" summary

zhaozj2021-02-16  141

I just read Wang Shen's "deep J2SDK", benefiting is not shallow, I hope to see the colleague of this article to "Java Technology Forum" to Down. People who have come into contact with Java believe that it is unfamiliar with JDK (Java Run-Time Environment), JVM (Java Virtual Machine), where the relationship between JDK and JRE is represented by the following figure. Ok, it's ok:

I saw the picture above you find two sets of JRE in your computer, then what is JRE is doing? Look at the name of Java's running environment, look at the picture below, I believe you will have a deeper understanding Very clear, actually a separate virtual Java PC, just like Win32 program to help us run, Java programs also want JRE to run, but why do a PC has two JREs? That is because the JDK we used includes JavaC.exe, Java.exe, etc., it is actually developed with Java, so we must install JRE while installing JDK, or the tool in your JDK will Will not be used, and JRE in C: / Program File / Java is used to perform the Java program we have written, (but you can choose to install in JDK1.4, but JDK1.3 is not line), in Wang There is an experiment in the "in-depth J2SDK" of Sen 's brother. It also proves that the compilation command we said is actually a wrapper (WARPPER), if you enter java -classpath d: /j2sdk1.4.0/lib/tools.jar com.sun.tools.javac.main, the result you get is the same as you enter Javac, so Javac's role is just to let you don't have to knock too much instruction. Have you found that there are three options in -client, -server, -hotspot when you enter Java, but when you enter Java-Server, you will appear back to Error Message: "Error: no` NO `Server 'JVM AT` C : / Program files / java / jre1.5.0 / bin / server / jvm.dll '. ", Ok, now try this: I put JDK in the root directory of the C drive, enter: PATH = C: / JDK / BIN; (depending on your situation), then knock in: java -server -version; haha, optimistic, the results are as follows: Java Version "1.4.2" Java (TM) 2 Runtime ENVIRONMENT, STANDARD Edition (Build 1.4.2-B28) Java Hotspot (TM) Server VM (Build 1.4.2-B28, MIXED MODE) I saw? Is Server VM! If you don't see Wang Sen's "deep J2SDK", then I will tell you the secret, first look at the JRE in your jdk directory, what is different from you in the jre, right, JDK Under the bin directory of JRE, the Server folder, and this is the Java's Server virtual machine; then you have to understand a few things to explain the situation just happen: First: Search to see you How many java.exe in the computer, there is a java.exe in your C: / windows / system32 folder, the second: You have to know that Java you want to know. .exe, generally said that one of C: / Windows / System32, the third: (very important) Which java.exe you want to run in JRE, here is its own logic; 1. There is no JRE directory in your own directory.

转载请注明原文地址:https://www.9cbs.com/read-7987.html

New Post(0)