Setup Xiang Xiang Xiang Xiang's Java Environmental Variable under Windows

xiaoxiao2021-03-06  63

Setup Xiang Xiang Xiang Xiang's Java Environmental Variable under Windows

Copyright Notice: 9CBS is this BLOG managed service provider. If this paper involves copyright issues, 9CBS does not assume relevant responsibilities, please contact the copyright owner directly with the article Author.

Setup Xiang Xiang Xiang Xiang's Java Environmental Variable under Windows

There are 3 environment variables for Java under Windows, Java_Home, ClassPath, Path. The following analyzes.

Java_home points to the JDK installation path, such as x: /jdk_1.4.2, in which you should be able to find bin, lib and other directories. It is worth mentioning that the JDK installation path can choose any disk directory, but it is recommended that you put on the directory level, if you put the directory deep, such as x: / xxxxxx / xxxxx / xxxx / xxxx / xxxx / xxxx / XXXX / XXX ... Then, the following steps and after the app, you have to be tired, huh, huh. Setting method: java_home = x: /jdk_1.4.2

Path Environment Variables are originally Windows, you just need to modify it, let him point to the JDK bin directory so you don't need to type a large string path when you compile it under the console. The setting method is to keep the original PATH content and add% java_home% / bin (note, if you don't understand DOS batch, you may not understand what the content caused by %%; in fact, here is a reference The last step sets the environment variable java_home, you write to x: /jdk_1.4.2 is also possible; you can open a console window, enter Echo% java_home% to see your setup results): Path =% java_home% / BIN;% PATH%,% PATH% is a reference to the PATH environment variable you set before, you will take the previous value.

The ClassPath environment variable I put in the end because 80% of the inexplicable blame you appear later may be due to the ClassPath settings, so be more careless. ClassPath =. /;% Java_home% / lib / Tools.jar first pays attention to the forefront "./;", if you can't see it, I will give you a commemoration - a seller semicolon. This is telling JDK. Search for Class Find the current directory in the current directory - why this is caused by Linux security mechanism, Linux users understand that Windows users are difficult to understand (because Windows default search order is Search for the current directory, then search the system directory, then search the PATH environment variable settings), so if you like the friends who like to find it may wish to study Linux. Why is the specific file of Tools.jar later behind ClassPath? Don't you specify? Obviously, I can still so Luo Su! :) This is determined by the Java language IMPORT mechanism and JAR mechanism, you can check the information.

Oh, specific setting method: win2k / xp users Right click on My Computer -> Properties -> Advanced -> Environment Variables, modify the value in the box below. Win9x users modify the autoexec.bat file, join: set java_home = x: /jdk_1.4.2set path =% java_home% / bin;% PATH% SET ClassPath =. /;% java_home% / lib / Tools.jar Yes.

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

New Post(0)