What is the name of the program file that you can enter in the Windows search
Environment variables are global system variables accessible by all the processes/users running under the Operating System (OS), such as Windows, macOS and Linux. Environment variables are useful to store system-wide values, for examples, Show
(Windows) Environment VariablesEnvironment Variables in Windows are NOT case-sensitive (because the legacy DOS is NOT case-sensitive). They are typically named in uppercase, with words joined with underscore ( set VAR_NAME VAR_NAME=VAR_VALUE2), e.g., set VAR_NAME VAR_NAME=VAR_VALUE3. Display Environment Variables and their ValuesTo list ALL the environment variables and their values, start a CMD and issue the command " set VAR_NAME VAR_NAME=VAR_VALUE4", as follows, Try issuing a " set VAR_NAME VAR_NAME=VAR_VALUE4" command on your system, and study the environment variables listed. Pay particular attention to the variable called Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5. To display a particular variable, use command " set VAR_NAME VAR_NAME=VAR_VALUE7", or " set VAR_NAME VAR_NAME=VAR_VALUE8": // Display a particular variable set COMPUTERNAME COMPUTERNAME=xxxxxx // or, use "echo" command with variable name enclosed within a pair of '%' echo %COMPUTERNAME% COMPUTERNAME=xxxxxx Set/Unset/Change an Environment Variable for the "Current" CMD SessionTo set (or change) a environment variable, use command " set VAR_NAME VAR_NAME=VAR_VALUE9". There shall be no spaces before and after the // (Windows 2000/XP/Vista/7/8/10) "cmd.exe" abc 'abc' is not recognized as an internal or external command, operable program or batch file. // (Windows 95/98) "command.com" abc Bad command or file name0 sign. To unset an environment variable, use " // (Windows 2000/XP/Vista/7/8/10) "cmd.exe" abc 'abc' is not recognized as an internal or external command, operable program or batch file. // (Windows 95/98) "command.com" abc Bad command or file name1", i.e., set it to an empty string. set varname set varname=value set varname= set Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables For examples, An environment variable set via the " set VAR_NAME VAR_NAME=VAR_VALUE4" command under CMD is a local, available to the current CMD session only. Try setting a variable, re-start CMD and look for the variable. Using an Environment VariableTo reference a variable in Windows, use // (Windows 2000/XP/Vista/7/8/10) "cmd.exe" abc 'abc' is not recognized as an internal or external command, operable program or batch file. // (Windows 95/98) "command.com" abc Bad command or file name3 (with prefix and suffix of // (Windows 2000/XP/Vista/7/8/10) "cmd.exe" abc 'abc' is not recognized as an internal or external command, operable program or batch file. // (Windows 95/98) "command.com" abc Bad command or file name4). For example, you can use the // (Windows 2000/XP/Vista/7/8/10) "cmd.exe" abc 'abc' is not recognized as an internal or external command, operable program or batch file. // (Windows 95/98) "command.com" abc Bad command or file name5 command to print the value of a variable in the form " set VAR_NAME VAR_NAME=VAR_VALUE8". How to Add or Change an Environment Variable "Permanently"To add/change an environment variable permanently in Windows (so that it is available to ALL the Windows' processes/users and stayed across boots):
You need to RE-START CMD for the new setting to take effect! To verify the new setting, launch CMD: set VAR_NAME VAR_NAME=VAR_VALUE PATH Environment Variable in WindowsWhen you launch an executable program (with file extension of " // (Windows 2000/XP/Vista/7/8/10) "cmd.exe" abc 'abc' is not recognized as an internal or external command, operable program or batch file. // (Windows 95/98) "command.com" abc Bad command or file name7", " // (Windows 2000/XP/Vista/7/8/10) "cmd.exe" abc 'abc' is not recognized as an internal or external command, operable program or batch file. // (Windows 95/98) "command.com" abc Bad command or file name8" or " // (Windows 2000/XP/Vista/7/8/10) "cmd.exe" abc 'abc' is not recognized as an internal or external command, operable program or batch file. // (Windows 95/98) "command.com" abc Bad command or file name9") from the CMD shell, Windows searches for the executable program in the current working directory, followed by all the directories listed in the Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5 environment variable. If the program cannot be found in these directories, you will get the following error: // (Windows 2000/XP/Vista/7/8/10) "cmd.exe" abc 'abc' is not recognized as an internal or external command, operable program or batch file. // (Windows 95/98) "command.com" abc Bad command or file name To list the current Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5, issue command: PATH PATH=path1;path1;path3;... How to Add a Directory to the PATH in WindowsTo add a directory to the existing Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5 in Windows:
You need to RE-START CMD for the new PATH setting to take effect! To verify the new setting, launch CMD: PATH PATH=path1;path2;path3;... Notes:
(macOS/Linux) Environment VariablesEnvironment variables in macOS/Unixes are case-sensitive. Global environment variables (available to ALL processes) are named in uppercase, with words joined with underscore ( set VAR_NAME VAR_NAME=VAR_VALUE2), e.g., set VAR_NAME VAR_NAME=VAR_VALUE3. Local variables (available to the current process only) are in lowercase. Using Environment Variables in Bash ShellMost of the Unixes (Ubuntu/macOS) use the so-called Bash shell. Under PATH PATH=path1;path1;path3;...9 shell:
How to Set an Environment Variable Permanently in Bash ShellYou can set an environment variable permanently by placing an export CLASSPATH=.:/usr/local/tomcat/lib/servlet-api.jar7 command in your Bash shell's startup script " export CLASSPATH=.:/usr/local/tomcat/lib/servlet-api.jar8" (or export CLASSPATH=.:/usr/local/tomcat/lib/servlet-api.jar9", or " // Refresh the bash shell source ~/.bashrc // or source ~/.bash_profile source ~/.profile source /etc/profile0") of your home directory; or " // Refresh the bash shell source ~/.bashrc // or source ~/.bash_profile source ~/.profile source /etc/profile1" for system-wide operations. Take note that files beginning with dot ( PATH PATH=path1;path1;path3;...3) is hidden by default. To display hidden files, use command " // Refresh the bash shell source ~/.bashrc // or source ~/.bash_profile source ~/.profile source /etc/profile3" or " // Refresh the bash shell source ~/.bashrc // or source ~/.bash_profile source ~/.profile source /etc/profile4". For example, to add a directory to the Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5 environment variable, add the following line at the end of // Refresh the bash shell source ~/.bashrc // or source ~/.bash_profile source ~/.profile source /etc/profile6" (or export CLASSPATH=.:/usr/local/tomcat/lib/servlet-api.jar9", or " // Refresh the bash shell source ~/.bashrc // or source ~/.bash_profile source ~/.profile source /etc/profile0"), where // Refresh the bash shell source ~/.bashrc // or source ~/.bash_profile source ~/.profile source /etc/profile9 denotes the home directory of the current user, or " // Refresh the bash shell source ~/.bashrc // or source ~/.bash_profile source ~/.profile source /etc/profile1" for ALL users. (For Java) You can set the abc bash: abc: command not found1 environment variables by adding the following line. For example, export CLASSPATH=.:/usr/local/tomcat/lib/servlet-api.jar Take note that Bash shell uses colon ( PATH PATH=path1;path1;path3;...6) as the path separator; while windows use semicolon ( PATH PATH=path1;path1;path3;...5). To refresh the bash shell, issue a " abc bash: abc: command not found4" command (or re-start the bash shell): // Refresh the bash shell source ~/.bashrc // or source ~/.bash_profile source ~/.profile source /etc/profile (Notes) For the older csh (C-shell) and ksh (Korn-shell)
PATH Environment VariableMost of the Unixes and macOS use the so-called Bash Shell in the "Terminal". When you launch an executable program (with file permission of executable) in a Bash shell, the system searches the program in ALL the directories listed in the Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5. If the program cannot be found, you will get the following error: abc bash: abc: command not found Take note that the current directory ( PATH PATH=path1;path1;path3;...3) is not searched, unless it is included in the Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5. To run a program in the current directory, you need to include the current path ( set varname set varname=value set varname= set04), for example, set varname set varname=value set varname= set0 To list the current Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5, issue command: set varname set varname=value set varname= set1 How to Add a Directory to the PATH in macOS/LinuxTo add a directory to the existing Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5 in macOS/Unixes, add the following line at the end of one of the startup scripts, such as // Refresh the bash shell source ~/.bashrc // or source ~/.bash_profile source ~/.profile source /etc/profile6", " set varname set varname=value set varname= set08" export CLASSPATH=.:/usr/local/tomcat/lib/servlet-api.jar9", " // Refresh the bash shell source ~/.bashrc // or source ~/.bash_profile source ~/.profile source /etc/profile0" (where // Refresh the bash shell source ~/.bashrc // or source ~/.bash_profile source ~/.profile source /etc/profile9 denotes the home directory of the current user) or " // Refresh the bash shell source ~/.bashrc // or source ~/.bash_profile source ~/.profile source /etc/profile1" for ALL users. To refresh the bash shell, issue a " abc bash: abc: command not found4" command (or re-start the bash shell): // Refresh the bash shell source ~/.bashrc // or source ~/.bash_profile source ~/.profile source /etc/profile To verify the new setting, launch CMD: set varname set varname=value set varname= set1 Notes:
Java Applications and the Environment Variables PATH, CLASSPATH, JAVA_HOMEMany problems in the installation and running of Java applications are caused by incorrect setting of environment variables (global system variables available to all the processes/users running under the Operating System), in particular, Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5, abc bash: abc: command not found1 and set VAR_NAME VAR_NAME=VAR_VALUE3. When you launch a program from the command line, the Operating System uses the Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5 environment variable to search for the program in your local file system. In other words, Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5 maintains a list of directories for searching executable programs. PATH (For Windows)When you launch an executable program (with file extension of " // (Windows 2000/XP/Vista/7/8/10) "cmd.exe" abc 'abc' is not recognized as an internal or external command, operable program or batch file. // (Windows 95/98) "command.com" abc Bad command or file name7", " // (Windows 2000/XP/Vista/7/8/10) "cmd.exe" abc 'abc' is not recognized as an internal or external command, operable program or batch file. // (Windows 95/98) "command.com" abc Bad command or file name8" or " // (Windows 2000/XP/Vista/7/8/10) "cmd.exe" abc 'abc' is not recognized as an internal or external command, operable program or batch file. // (Windows 95/98) "command.com" abc Bad command or file name9") from the CMD shell, Windows searches for the executable program in the current working directory, followed by all the directories listed in the Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5 environment variable. If the program cannot be found in these directories, you will get the following error: // (Windows 2000/XP/Vista/7/8/10) "cmd.exe" abc 'abc' is not recognized as an internal or external command, operable program or batch file. // (Windows 95/98) "command.com" abc Bad command or file name For example, if you are trying to use Java Compiler " set varname set varname=value set varname= set30" to compile a Java source file, but " set varname set varname=value set varname= set30" cannot be found in the current directory and all the directories in the Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5, you will receive the following error: set varname set varname=value set varname= set6 Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5 maintains a list of directories. The directories are separated by semicolon ( PATH PATH=path1;path1;path3;...5) in Windows. For Java applications, Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5 must include the following directories:
The JDK's " set varname set varname=value set varname= set36" directory should be listed before " set varname set varname=value set varname= set40" and " set varname set varname=value set varname= set41" in the Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5. This is because some older Windows systems provide their own Java runtime (which is often outdated) in these directories (try search for " set varname set varname=value set varname= set39" in your computer, you may find a few entries). To add a directory (say JDK's " set varname set varname=value set varname= set36") to the existing PATH, check "How to add a directory to the PATH". PATH (For macOS/Linux)Most of the Unixes and macOS use the so-called Bash Shell in the "Terminal". When you launch an executable program (with file permission of executable) in a Bash shell, the system searches the program in ALL the directories listed in the Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5. If the program cannot be found, you will get the following error: abc bash: abc: command not found For example, if you are trying to use Java Compiler " set varname set varname=value set varname= set49" to compile a Java source file, but " set varname set varname=value set varname= set49" can not be found in the list of directories in the Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5, you will receive the following error: set varname set varname=value set varname= set8 To support Java applications, you need to include the JDK's " set varname set varname=value set varname= set36" (binary) directory in the PATH. See "How to add a directory to the PATH". Java Archive (JAR) FileFor ease of distribution, Java classes are often archived (zipped) together into a so-called JAR file. To use a third-party Java package, you need to place the distributed JAR file in a location that is available to the Java Compiler and Java Runtime. How Classes are Found?Java Compiler (" set varname set varname=value set varname= set49"), Java Runtime (" set varname set varname=value set varname= set54") and other Java tools searches for classes used in your program in this order:
Cannot Find ClassesIf the Java Runtime (" set varname set varname=value set varname= set54") cannot find the classes used in your program in all the above places, it will issue error "Could not find or load main class xxxx" (JDK 1.7) or "java.lang.NoClassDefFoundError" (Prior to JDK 1.7). Similarly, Java Compiler (" set varname set varname=value set varname= set49") will issue compilation errors such as "cannot find symbol", "package does not exist". Notes: External native libraries (" set varname set varname=value set varname= set85", " set varname set varname=value set varname= set86", " set varname set varname=value set varname= set87", " set varname set varname=value set varname= set88") are to be found in a path in JRE's Property " set varname set varname=value set varname= set89", which normally but not necessarily includes all the directories in the Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5 environment variable. Otherwise, you will get a runtime error " set varname set varname=value set varname= set91". CLASSPATH Environment VariableThe abc bash: abc: command not found1 environment variable could include directories (containing many class files) and JAR files (a single-file archive of class files). If abc bash: abc: command not found1 is not set, it is defaulted to the current directory. If you set the abc bash: abc: command not found1, it is important to include the current working directory ( PATH PATH=path1;path1;path3;...3). Otherwise, the current directory will not be searched. A common problem in running hello-world program is: abc bash: abc: command not found1 is set but does not include the current working directory. The current directory is therefore not searched, which results in "Error: Could not find or load main class Hello". You can simply remove the abc bash: abc: command not found1, and leave the class path defaulted to the current directory. For a beginner, no explicit abc bash: abc: command not found1 setting is required. The default abc bash: abc: command not found1 setting of current directory is sufficient. Remove all abc bash: abc: command not found1 setting if there is any. However, if you have to set abc bash: abc: command not found1, make sure that you include the current directory Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables02. The Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables5 environment variable (for searching the executable programs) is applicable to all applications; while abc bash: abc: command not found1 is used by Java only. Read JDK documents "Setting the abc bash: abc: command not found1" and "How Classes are Found" (you can find the hyperlinks from the index page of the JDK documentation, or googling). CLASSPATH Environment Variable (For Windows)The abc bash: abc: command not found1 accepts directories and jar-files. Path entries are separated by semicolon ( PATH PATH=path1;path1;path3;...5). Example: Displaying and changing abc bash: abc: command not found1 for the current CMD session. You can set the abc bash: abc: command not found1 permanently. See "How to Set an Environment Variable". CLASSPATH (for macOS/Ubuntu)
JAVA_HOME and JRE_HOMEMany Java applications (such as Tomcat) require the environment variable set VAR_NAME VAR_NAME=VAR_VALUE3 to be set to the JDK installed directory. How to Set JAVA_HOME in WindowsFirst, check if set VAR_NAME VAR_NAME=VAR_VALUE3 is already set by start a CMD and issue: Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables0 If set VAR_NAME VAR_NAME=VAR_VALUE3 is not set, you will receive "Environment variable JAVA_HOME not defined". Otherwise, the current setting will be shown. To set/change set VAR_NAME VAR_NAME=VAR_VALUE3 in Windows:
You need to RE-START CMD for the new setting to take effect! To verify the new setting, re-start CMD: Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables1 How to Set JAVA_HOME in Linux/macOS (Bash Shell)First, check if set VAR_NAME VAR_NAME=VAR_VALUE3 is already set by start a terminal and issue: Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables2 set VAR_NAME VAR_NAME=VAR_VALUE3 is to be set to the JDK installed directory. You need to find your JDK installed directory. [TODO] find macOS and Ubuntu JDK installed directory. Add the the following line at the end of // Refresh the bash shell source ~/.bashrc // or source ~/.bash_profile source ~/.profile source /etc/profile6" (or " set varname set varname=value set varname= set08"). Take note that filename beginning with dot ( PATH PATH=path1;path1;path3;...3) is hidden by default. [TODO] How to un-hide for macOS/Ubuntu. Display the value of the variable Set or change the value of the variable (Note: no space before and after '=') Delete the variable by setting to empty string (Note: nothing after '=') Display ALL the environment variables3 You need to refresh the bash shell for the new settings to take effect. Issue a " abc bash: abc: command not found4" command as follows: What is the name of the program file that you can enter in the Windows Search box to execute event viewer?Way 2: Turn on Event Viewer via Run.
Press Windows+R to open the Run dialog, enter eventvwr (or eventvwr. msc) and hit OK.
What is Windows Search application?Windows Search is a desktop search platform that has instant search capabilities for most common file types and data types, and third-party developers can extend these capabilities to new file types and data types.
What is Windows Search Windows 7?The Search feature of Windows 7 allows you to search your hard drive for files. Note: It will not search through HTML files. Open the Start Menu. Enter the the file name you are searching for in the Search field.
|