How to set PATH and Class Path to run JAVA program
Set PATH and Class Path to run JAVA program
If you have installed JRE and unable to run the java program, then stop for a moment, you will not be able to run the program till you do not set the path and classpath of your installed JRE.
If you want to set path and classpath using command prompt
Here you have to give the JDK/bin directory path
Here you have to give the JDK/lib path
If you are using windows to set the path and classpath, just follow the steps
Right Click on the MyComputer > Properties > Advanced > Environment Variables
Now you will have a window showing user variables and System variables.
You have to find the variable name path, if it already contains path variable, just edit the path folder and edit the value, include ;C:\Java\jdk1.5.0_03\bin; after the last value.
If you are unable to find the PATH folder, just create new and give variable name path and value C:\Java\jdk1.5.0_03\bin
Same case in CLASSPATH, if already contains, just edit it with ;C:\Java\jdk1.5.0_03\lib; or create it and give name CLASSPATH and value C:\Java\jdk1.5.0_03\lib
Now you can compile and run the java program easily.
I will show you the steps in my video tutorials.
SET JAVA PATH and CLASSPATH in Window 7
How to Install Java