Setting method of Java environment variables under Windows

  • 2020-04-01 02:15:25
  • OfStack

Configure JDK environment variables under Windows xp:
1.
Install JDK, you can customize the installation directory and other information during the installation process, for example, we choose the installation directory as D:/ Java /jdk1.5.0_08;

2. After installation, right - click "my computer" and click "properties".

3. Select the advanced TAB and click environment variables.

4. In the "system variables", set three properties, JAVA_HOME,PATH,CLASSPATH(case does not matter). If it exists, click "edit"; if it does not exist, click "new";

5. JAVA_HOME specifies the JDK installation path, which is the path D:/java/jdk1.5.0_08, which includes lib, bin, jre and other folders (this variable is best set, because later running tomcat, eclipse, etc.);

Path allows the system to recognize Java commands in any Path, set as:

% % JAVA_HOME/bin; % JAVA_HOME % / jre/bin

CLASSPATH loads the class (class or lib) path for Java. Only if the class is in the CLASSPATH, can the Java command recognize it.

.; % JAVA_HOME % / lib/dt. Jar; %JAVA_HOME%/lib/tools.jar

%JAVA_HOME% is a reference to the previously specified JAVA_HOME;

6. "Start" - >; "Run", type "CMD";

7. Type command "java-version", "Java", "javac" several commands, the screen appears, indicating that the environment variable configuration is successful;

8. All right, call it a day. Here's your first Java program.


Related articles: