java set environment variable

Tools/Materials

 
  • environment variable

  • JDK 

method/step

 
  1.  

    First download and install the JDK installation package. During the installation process, pay attention to installing it to another disk, not to the C drive.

    java set environment variable
  2.  

    Open My Computer--Properties--Advanced--Environment Variables:



    java set environment variable
  3.  

    New system variables JAVA_HOME and CLASSPATH 
    Variable name: JAVA_HOME 
    variable value: C:\Program Files\Java\jdk1.7.0
    Variable name: CLASSPATH 
    variable value: .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools .jar;

    The variable value is the file directory where you installed jdk yourself. Pay attention here.

    java set environment variable
  4.  

    Select the environment variable named "Path" in the "System Variables", double-click the variable, add the absolute path of the bin directory in the JDK installation path to the value of the Path variable, and use the semicolon and the existing path. to separate. 
    Variable name: Path 
    variable value: %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
    This is the environment configuration of java. After the configuration is completed, start eclipse directly, and it will automatically complete the configuration of the java environment

    java set environment variable
  5.  

    Now test whether the configuration of the environment variable is successful or not. Enter "JAVAC" in the DOS command line window, and the output of the help information means the configuration is correct. As shown in the figure:

    java set environment variable
  6.  

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327012376&siteId=291194637