更新时间:2023-01-14 22:18:45
除了设置 JAVA_HOME 系统变量外,您还需要设置 Path 变量,因为 Path 是操作系统用于从终端窗口中找到所需可执行文件的系统变量.
Apart from setting the JAVA_HOME system variable you need to set the Path variable as well because the Path is the system variable that your Operating system uses to locate the needed executable from the terminal window.
因此,设置路径变量的步骤如下:
So for setting the Path Variable proceed as follows:
请注意,在执行上述步骤之前,还请检查是否正确设置了JAVA_HOME变量.为此,请转到命令提示符并键入 echo%JAVA_HOME%.如果设置正确,它将为您提供jdk的路径.
Note that before following the above steps also check if your JAVA_HOME variable is properly set. For doing this go to command prompt and type echo %JAVA_HOME%. If it is properly set then it will give you the path of your jdk.
注意: :有时会同时设置 Path 和 JAVA_HOME 变量,但仍然存在不起作用.为避免这种情况,请以管理员身份运行命令提示符.
NOTE: Sometimes it happens that both the Path and JAVA_HOME variables are set properly but still things are not working.To avoid this run the command prompt as administrator.