Environment variables are global system variables
accessible by all the processes running under the Operating System (OS).
Environment variables are useful to store system-wide values such as
the directories to search for the executable programs, the OS version,
and the location of Windows binaries.After Installation of Java, you cannot compile programs until you have
directory to your path environment variable if not already present, otherwise
the tools won't be found when you try to compile and run programs. So you need to Set up Class path First. This tutorial explains how you can do that.If you want help on how to download or install Jdk, you can Read It Here
Here is Step by Step guide for setting Java Classpath in Windows
Setting Java Class Path
Classpath in Java is path to directory or list of directory which is used byClassLoaders to find and load class in Java program.- Go to Environment variable window in Windows by pressing "Windows + Pause" > Advanced > Environment variable " or you can go from right click on my computer than choosing properties and then Advanced and then Environment variable this will open Environment variable window.
- Now specify your environment variable CLASSPATH and put the value of your JAVA_HOME\lib and also include current directory by including (dot or period sign).
- Now to check the value of Java classpath in windows type "echo %CLASSPATH" in your DOS command prompt and it will show you the value of directory which are included in CLASSPATH.
You can also set classpath in windows by using DOS command like :
set CLASSPATH=%CLASSPATH%;JAVA_HOME\lib;
- This way you can set classpath in Windows XP, windows 2000 or Windows 7 and 8, as they all come with command prompt.
No comments:
Post a Comment