Environment variables: (Windows 7) Right-click the computer on the desktop, select properties, and click Advanced System settings on the left. The system properties setting box is displayed. Click the environment variables at the bottom, the environment variable Setting dialog box is displayed.
Environment variables include system variables and user variables. If configured in user variables, the environment variables take effect only for the current user. If configured as system variables, they take effect for all users, there should be no other difference.
In the environment variables, we use two special environment variables: PATH and CLASSPATH, you can run the following commands directly at the command prompt:
We add your JDK directory (for example, D: \ JAVA \ JDK1.7.0 \ binning) to the environment variable, which includes files such as java.exe and javac.exe. We can execute commands such as java and javac at the command prompt. Another CLASSPATH is not mentioned here. You can reference the environment variable in the environment variable configuration in the following format: % variable name % English ending point (.) represents any current path.
Java environment variable configuration: Configure JAVA_HOME (in the format of variable name = variable value [Example value]): JAVA_HOME = Your JDK directory [D: \ Java \ jdk1.7.0] configure JRE_HOME (optional) JRE_HOME = Your JRE directory [D: \ Java \ jdk1.7.0 \ jre]
PATH configuration: Find the PATH variable in the system variable. If not, create a new variable. If yes, double-click it and add it after the existing variable value, variable configuration values are separated by semicolons (;). You need to add the following variable values: PATH = % JAVA_HOME % \ binPATH = % JRE_HOME % \ bin (optional) Configure CLASSPATH: CLASSPATH = D: \ Java \ jdk1.7.0 \ lib \ dt. jar
TOMCAT configuration: Configure CATALINA_HOME: CATALINA_HOME = Your TOMCAT directory [D: \ Develop \ apache-tomcat-7.0.2] configure PATH: PATH = % CATALINA_HOME % \ bin for testing: start "->;" run ", and type" cmd "(test here). You can enter the following commands:" java-version "," java ", and" javac, when the screen appears, the environment variable is successfully configured.