java配置环境变量Path和classpath

path:

1.环境变量有很多,其中最常见的环境变量名为Path。

2.Path是系统指定的可执行文件的路径。例如:在CMD窗口输入.exe程序名,系统会在Path路径找这个文件。

3.Path路径不止一个,优先搜索最靠前的路径下的文件。搜索成功后,停止;否则,继续找下一个路径。

如:下列为作者机器上的Path路径:

C:UsersLeon>echo %path%
C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:WindowsSystem32OpenSSH;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program FilesPuTTY;C:Program FilesGitcmd;C:Program FilesMiKTeX 2.9miktexinx64;C:UsersLeonAppDataLocalMicrosoftWindowsApps;;C:Program FilesJetBrainsPyCharm 2018.3.2in;

4.在CMD中设置临时环境变量:

  set path=%path%;C:Javain

临时变量只有在当前CMD窗口中才有效,其他窗口无效~

5.在系统的窗口下设置环境变量是永久生效的。

6.把C:Javain置顶,可以首先在这个文件中查找程序。

结果为:

C:UsersLeon>echo %path%
C:Javain;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:WindowsSystem32OpenSSH;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program FilesPuTTY;C:Program FilesGitcmd;C:Program FilesMiKTeX 2.9miktexinx64;C:UsersLeonAppDataLocalMicrosoftWindowsApps;;C:Program FilesJetBrainsPyCharm 2018.3.2in;

classpath:

原文地址:https://www.cnblogs.com/yulianggo/p/10400635.html