MEWBIES@: Facebook Twitter G+ YouTube DeviantArt Forum Wall
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ ██
█▌ - HOW TO SET ENVIRONMENT VARIABLES - █▌
█▌ █▌
█ ▐▌
█ This tutorial is for Windows. Have you ever had instructions where you ▐▌
█ needed to type into a Command Prompt window a cmd (command) and the only ▐▌
█ reply you received was similar to "'x' is not recognized as an internal or ▐▌
█ external command, operable program or batch file." and you know you have ▐▌
█ the prerequisite installed? Well the problem most likely is that the ▐▌
█ 'Environment Variable' isn't set yet. Many programs will do this during ▐▌
█ install, others you need to do it. ▐▌
█ ▐▌
█ For this example will use Java since many have this installed. You can use ▐▌
█ the same method on any executable file. ▐▌
█ ▐▌
█ TEST YOUR COMMAND: ▐▌
█ `````````````````` ▐▌
█ 1.) Open a command prompt window: ▐▌
█ Windows XP: ▐▌
█ Press the Window's Start button, then Run, then type in the Open drop down ▐▌
█ window: cmd ▐▌
█ Press OK ▐▌
█ ▐▌
█ Windows Vista & 7: ▐▌
█ Press the Windows logo key on your keyboard +r to launch Run, then type in ▐▌
█ the Open drop down window: cmd ▐▌
█ Or Press the Window's Start button/Start Search box/ type in the Open drop ▐▌
█ down window: cmd ▐▌
█ Press OK ▐▌
█ ▐▌
█ 2. Now the type the cmd in, for this example: java ▐▌
█ Your reply should be the options or information for the program, such as: ▐▌
█ Usage: java [-options] class [args...] ▐▌
█ [snip] ▐▌
█ ▐▌
█ FIND LOCATION OF EACH: ▐▌
█ `````````````````````` ▐▌
█ First you need to find the location of the program that is being called ▐▌
█ upon, for example java would be java.exe ▐▌
█ Browse to your java installed folder and find java.exe or search C:/ for ▐▌
█ it. ▐▌
█ For java.exe I have two since I have JRE and JDK installed. ▐▌
█ I'll use the JDK java.exe which, for my install, is located in the bin ▐▌
█ directory here: ▐▌
█ C:\Program Files\Java\jdk1.6.0_18\bin ▐▌
█ ▐▌
█ If you didn't find the location for your program, then most likely you ▐▌
█ don't have it installed. ▐▌
█ ▐▌
█ ADD ENVIRONMENT VARIABLE: ▐▌
█ ````````````````````````` ▐▌
█ HERE is a screen recording (.swf) of setting an environment variable. ▐▌
█ Or if you can't view Flash .swf files below is a YouTube video of the same,▐▌
█ music credits: A snippet from Analysis by Phaze Zero, title Reflexions: ▐▌
█ ▐▌
█ ▐▌
█ 1. Open Environment Variables: ▐▌
█ XP: Right click on 'My Computer'/Advanced /Environment Variables/ ▐▌
█ Vista: Control Panel/User Accounts/Left pane click on 'Change my ▐▌
█ environment variables ▐▌
█ Win 7: Right click on 'My Computer' then select on left pane 'Advanced ▐▌
█ system settings'/Advanced /Environment Variables/ ▐▌
█ ▐▌
█ 2. In the 'System Variables' window double click on 'Path'. ▐▌
█ Note you might have 'PATH' listed under 'User variables for User', this is ▐▌
█ not the same. ▐▌
█ This will open its window. ▐▌
█ ▐▌
█ 3. Paste in the path to your program at the 'end' of the list like this ▐▌
█ for the java.exe example above: ▐▌
█ ;C:\Program Files\Java\jdk1.6.0_18\bin ▐▌
█ Or if your program is in 'C:\WINDOWS\...' for example: ▐▌
█ C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe then you would paste in: ▐▌
█ ;%SystemRoot%\Microsoft.NET\Framework\v3.5 ▐▌
█ ▐▌
█ Notes: ▐▌
█ A. ';%SystemRoot%' is used when it is found here: C:\WINDOWS ▐▌
█ B. The line begins with a ; ▐▌
█ This is used to separate the programs, be sure you paste that in. ▐▌
█ C. My Path variable line is very long. If I want to edit something in it ▐▌
█ what I do is just copy it all to a text editor like Notepad++ or WordPad, ▐▌
█ edit the line, then paste entire line back in. Do NOT use Notepad unless ▐▌
█ you are confident that it isn't going to add any line breaks (Win XP SP3). ▐▌
█ ▐▌
█ 4. Click OK three times. ▐▌
█ Open a NEW command prompt window and type in: ▐▌
█ java ▐▌
█ And if you are using JDK, you now have enabled javac as well: ▐▌
█ javac ▐▌
█ ▐▌
█ Done, that is if using java JRE (Java Runtime Environment) as the example. ▐▌
█ ▐▌
█ 5. If you are using JDK (Java Development Kit) for example you still need ▐▌
█ to set one more: ▐▌
█ A. Find the location of 'tools.jar' ▐▌
█ For example: C:\Program Files\Java\jdk1.6.0_18\lib\tools.jar ▐▌
█ then the Variable value below would be: C:\Program Files\Java\jdk1.6.0_18 ▐▌
█ ▐▌
█ B. Need to add a new 'System variable': ▐▌
█ If 'JAVA_HOME' is not listed: ▐▌
█ Click New and enter for: ▐▌
█ Variable name: JAVA_HOME ▐▌
█ Variable value: C:\Program Files\Java\jdk1.6.0_18 ▐▌
█ ▐▌
█ If 'JAVA_HOME' is listed: ▐▌
█ Double click on JAVA_HOME and add at the end: ▐▌
█ ;C:\Program Files\Java\jdk1.6.0_18 ▐▌
█ ▐▌
█ C. Click OK three times. ▐▌
█ Done. ▐▌
█ ▐▌
█ 6. If you are using Microsoft Visual Studios (full not Express version or ▐▌
█ an add-on included with other software) you might need to update its ▐▌
█ variables each time you change them by doing this: ▐▌
█ cd C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\ ▐▌
█ vcvars32.bat ▐▌
█ ▐▌
█ 7. Other programs might require you to also add in Path some files they ▐▌
█ need. Normally you would know by the reply it gives you- if it complains ▐▌
█ about a missing file; read their install docs. ▐▌
█ For example to use the cmd 'cl' which is located here C:\Program ▐▌
█ Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe ▐▌
█ You would add to 'System variables'/ 'Path': ▐▌
█ ;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin ▐▌
█ Then test your cl cmd, open a 'new' cmd prompt window and try again: ▐▌
█ cl ▐▌
█ If it is working, done. If the reply is similar to 'missing mspdb80.dll ▐▌
█ and or mspdb71.dll' ▐▌
█ You now need to add 2 more paths for it to Path: ▐▌
█ ;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE;C:\Program Files\Microsoft Visual Studio 9.0\VC\bin
█ and then run vcvars32.bat again: ▐▌
█ cd C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\ ▐▌
█ vcvars32.bat ▐▌
█ Try your cmd again in a New command prompt window. ▐▌
█ ▐▌
█ OTHER VARIABLE TYPE EXAMPLES: ▐▌
█ ````````````````````````````` ▐▌
█ 1. You might have a program that states you need to add a path to for ▐▌
█ example 'CLASSPATH', but you don't have such a variable- you would create ▐▌
█ a new variable named 'CLASSPATH' and put the path in the value. ▐▌
█ ▐▌
█ //---------------------------------------------------------------------- ▐▌
█ ▐▌
█ If you find mistakes, have suggestions, and or questions please post at ▐▌
█ mewbies forum HERE - thank you. ▐▌
█ ▐▌
█ Last update on 19 May '10 ▐▌
█ ▐▌
█▌ █▌
█▌ - mewbies.com - █▌
█▌ █▌
██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄██