Main menu

Post navigation

How to set environment variables

Remember ‘set path’ and ‘set classpath’ when you need to access certain functions of an application from the command-line?

Something like:

set path=C:Program Files (x86)Javajdk1.6.0_18bin;

set classpath=C:Program Files (x86)Javajdk1.6.0_18lib;

When you’re doing java.

I still remember someone from my class patiently typing those series of words just to be able to compile a java program and execute it.

In this tutorial , I will show you how to apply one of the virtues of a programmer (laziness).

First, you need to click on the start orb, and right-click on ‘My Computer’ then select ‘properties’.

After that, go to ‘Advanced System Settings’, click on the ‘Advanced’ tab, then click on ‘Environment Variables’:

Under ‘System Variables’, scroll down until you see ‘Path’:

Highlight that then click on edit:

Go to its rightmost part by pressing the right arrow key on your keyboard, then put a semi-colon:

You can now include that path to the javac compiler, or any application function you wish to have access to when you use your command-line.

For java, you can do something like this, on 64-bit system, if you’re running 32-bit then just remove the part ‘(x86)’, or better yet check on your program files directory, then search for ‘java’ folder:

C:Program Files (x86)Javajdk1.6.0_18bin;

C:Program Files (x86)Javajdk1.6.0_18lib;

You can do this to almost any application, if you’re using yii as your php framework, then you can just add the directory to which your yi framework is installed: