2.1JDK's virtual machine JDK is divided into two parts. First, the Java runtime environment mentioned above is the development environment. They have a java virtual machine that has a JRE directory in the directory of the Java runtime environment and development environment, respectively, which is the real Java virtual machine! The virtual machine of the Java runtime environment is: C: // Program Files // javasoft ... // JRE 1.4 version may be: c: // program files // java // j2re1.4.0 java development environment Virtual machine in: D: // J2SDK // SE14 // JRE There are many Java.exe executables in the Windows environment, which ultimately they call virtual machines that call the above two! Select the virtual machine to use the Java Plug-in, the Java Rutime Environment menu in the Advanced tab on the Senior tab. Use the virtual machine of the Java runtime environment when you value. This two virtual machines installed in the same JDK basically no difference! 2.2 Executable files Java.exe and JavaC.exe Selection These two tools are used to perform Java programs and compile Java programs! Machines with JDK There are multiple Java and Javac files! We can choose to use a Java.exe or JavaC.exe file by setting the environment variable PATH! Multiple versions of java.exe and javac.exe cannot be universal, or you can't modify the location! That is to say when Java.exe under the Windows directory is moved to the JDK installation directory, it may not be executed (early Java.exe is like this, there is no such statement after 1.3, everyone can try it, 1.3 It seems to get the location of the virtual machine through the registry, not a relative path!). It is recommended to use java.exe under the c: // j2sdk // se14 // bin directory, this is a habit, there is no necessary reason! At this time, PATH can be set to Path = C: // J2SDK // SE14 // bin ;% PATH%, pay attention to the Windows directory there is also a java.exe !! This means that even if you do not set PATH, you can execute the Java program! In the PATH variable, the higher the executable of the directory will have the higher priority. Execution! Also, when there is file C.exe in the directory A and Directory B, if a in PATH is in B, the c.exe under the A directory is executed instead of B // C.EXE
Everyone pays attention to the author writes here a small error, carefully watch the position of the black body, and the description is inconsistent. Generally, JDK will make you choose the installation location when installing, but this is just the installation location of the development environment. ! The position of the Java runtime environment is constant. For single system, your runtime environment is in your system where your system is located / program files / java / j2re1.4.2 (my J2SE version 1.4.2, if you are not, you will not be too far), Your development environment is generally default installation under the drive /j2resdk1.4.2 where the system is located. I think, the author "recommends using the c: // j2sdk // se14 // bin directory Java.exe, this is a habit, there is no necessary reason!" This sentence means let us use the development environment Java.exe.
At this time, PATH can be set to path = c: // j2sdk // se14 // bin;% PATH%, pay attention to a java.exe !! also in the Windows directory !! In the PATH variable, the higher the executable of the directory will have the higher priority execution! Also, when there is file C.exe in the directory A and directory B, if a in Path is in B, it will be executed c.exe under a directory instead of B // C.exe
With regard to the setting of PATH, you can type PATH and PATH /? To view when you are in the DOS environment (start → CMD → OK). For example, I am (I am a dual system, now use a D disk operating system): Path = D: / windows / system32; d: / windows; d: / windows / system32 / wbem; E: / kav2003 can See, path, d: / windows is in the second, if you reset PATH is: Path = D: / Windows / System32; D: / Windows; D: / Windows / System32 / Wbem; E: / KAV2003; D: / J2SDK / So is the one you use, the Java.exe you use is still in D: / Windows. So it is best to place the Java development environment directory in the first place when you reite PATH. Simpleline: Right-click My Computer → Properties → Advanced → Environment Variables → System Variables. Here you can set the PATH.