Setting method of Java environment variables
- 2020-04-01 01:51:30
- OfStack
Install the JDK wizard to set the parameters. As shown in figure:
< img SRC = "/ / files.jb51.net/file_images/article/201305/2013051415365450.jpg" border = 0 > < img border = 0 SRC = "/ / files.jb51.net/file_images/article/201305/2013051415365451.jpg" >Relevant functions of the program being installed, as shown in the figure:
< img border = 0 SRC = "/ / files.jb51.net/file_images/article/201305/2013051415365452.jpg" >Choose the path to install. You can customize it or default it. As shown in figure:
< img border = 0 SRC = "/ / files.jb51.net/file_images/article/201305/2013051415365453.jpg" >After the successful installation, to test whether the installation is really successful, click "start" -- "run" -- enter CMD, enter "java-version" in the command prompt and press the enter key. As shown in figure:
< img SRC = "/ / files.jb51.net/file_images/article/201305/2013051415365454.jpg" border = 0 > < img SRC = "/ / files.jb51.net/file_images/article/201305/2013051415365455.jpg" border = 0 > < img border = 0 SRC = "/ / files.jb51.net/file_images/article/201305/2013051415365456.jpg" >To configure the environment variables, right-click [my computer] -- [properties] -- [advanced] -- [environment variables], as shown:
< img border = 0 SRC = "/ / files.jb51.net/file_images/article/201305/2013051415365457.jpg" >Select "new system variable" -- the "new system variable" dialog box pops up. Enter "JAVA_HOME" in the "variable name" text box. Enter the installation path of JDK (the folder path in step 5) in the "variable value" text box.
< img border = 0 SRC = "/ / files.jb51.net/file_images/article/201305/2013051415365458.jpg" >View the PATH variable in the "system variables" option area. If it does not exist, create a new variable PATH. Otherwise, select the variable, click the "edit" button, and add "%JAVA_HOME%\bin" at the beginning of the "variable value" text box. % JAVA_HOME % \ jre \ bin." Or simply "%JAVA_HOME%\bin;" , click the "ok" button, as shown in the figure:
< img border = 0 SRC = "/ / files.jb51.net/file_images/article/201305/2013051415365459.jpg" >View the CLASSPATH variable in the system variables option area. If it does not exist, create a new variable, CLASSPATH. The % JAVA_HOME % \ lib \ dt. Jar; % JAVA_HOME % \ lib \ tools. Jar;" . As shown in figure:
< img border = 0 SRC = "/ / files.jb51.net/file_images/article/201305/2013051415365460.jpg" >Now test the successful configuration of the environment variables. Enter "JAVAC" in the DOS command line window, and output the help message as configured correctly. As shown in figure:
< img border = 0 SRC = "/ / files.jb51.net/file_images/article/201305/2013051415365461.jpg" >
Matters needing attention
Remember not to leave out the last ";" Symbols.