Platform(s): Solaris SPARC, Solaris x86, Red Hat Linux, SUSE Linux, Windows XP (SP1 SP2), Vista
MORE TECHNICAL INFORMATION
The PATH is the system variable that your operating system uses to locate needed executables from the command line or Terminal window.
The PATH system variable can be set using System Utility in control panel on Windows, or in your shell's startup file on Linux and Solaris.
SOLUTION
Setting Path on Windows For Windows XP:
Start -> Control Panel -> System -> Advanced
Click on Environment Variables, under System Variables, find PATH, and click on it.
In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
Close the window.
Reopen Command prompt window, and run your java code.
For Windows Vista:
Right click “My Computer” icon
Choose “Properties” from context menu
Click “Advanced” tab (“Advanced system settings” link in Vista)
In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
Reopen Command prompt window, and run your java code.
Setting Path on Solaris and Linux
To find out if the java executable is in your PATH, execute: % java -version
This will print the version of the java executable, if it can find it. If you get error java: Command not found. Then path is not properly set.
To find out which java executable the first one found in your PATH, execute: % which java
Below are the steps to set the PATH permanently, Note: We are here giving instructions for two most popular Shells on Linux and Solaris.
Please visit link below if you are using any other shells. Path Setting Tutorial
If you require further assistance, please make sure you check through our
Help and FAQ sections thoroughly. We probably have a page that answers your question.