How to set path and classpath variable for java in Windows

Hello friends, In this post I am going to help you learn “How to set path and classpath variable for java in Windows” . Because Selenium WebDriver Using Java binary will always needs Java in classpath to execute your written selenium scripts.

So let’s starts

1-      Download  recent version of Java SE Development Kit

(You can download java SE

2-      Install JDK  and by Default Java installs at at this place  C:/Program Files(X86)/Java

3-      Java folder contain two folder of name jdk1.6.0_20 and jre6

4-      Now we will set the classpath and path for java in our windows machine

5-      Right Click on My Computer

6-      Now click on Advanced System Setting.

Java Classpath


7-      Click on Environment Variables on next window that appears after clicking Advanced System Setting.

Environment Variable in Windows

8-      Click on New  under system variable on Environment Variables Window


9-      A new window for New System Variable will open

10-   Before Variable Name  write path

11-   Before variable value type C:/Program Files(x86)/Java/jdk1.6.0_20/bin


12-   Click on Ok
13-   Now to set classpath again click on New and again New System Variables  will appear

14-   Enter

Variable name = classpath and Variable Value = C:/Program Files/Javajdk1.6.0_20/lib


15-   Now click Ok  and again click Ok on Environment Variables

16-   Finally we have set path and classpath  and now start you java coding  best of luck

I think you have learn enough and you would be able to “Set path and classpath variable for Java in Windows”

Note:  Now version might be 11 or something but basic steps will remain same.




Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.