How to configure java environment path in windows

For running any java application you have to set environment variable path on your machine

system variable like this:
JAVA_HOME = C:\Program Files\Java\jdk1.7.0_45
CLASS_PATH = C:\Program Files\Java\jdk1.7.0_45\bin\lib

Set Environment path on windows operating system

Right click on my computer -> properties -> Advance System Settings (see below screenshot)



Click on Environment Variables button it will open another window shown in below screenshot.



When you click on New button it will open a form to add variable name and value

Add following :

Variable name : JAVA_HOME 
Path : C:\Program Files\Java\jdk1.7.0_45 (your jdk installed path)

Add another :

Variable name : CLASS_PATH
Path :C:\Program Files\Java\jdk1.7.0_45\bin\lib (your jdk bin installed path)

Don't forget to reboot your system
 Set Environment path on linux operating system :

Set JAVA_HOME as follows using syntax export JAVA_HOME=<path-to-java>. If your path is set to /usr/java/jdk1.5.0_07/bin/java, set it as follows:

export JAVA_HOME=/usr/java/jdk1.5.0_07/bin/java

Set PATH as follows:

export PATH=$PATH:/usr/java/jdk1.5.0_07/bin