Friday, June 20, 2014

Java Classpath

java classpath windows | setting java classpath | set java classpath

For executing a java program you must need  JDK (java development kit). you can download it for free from java.sun.com (Sun's website for java download). Once you've downloaded install it and set the java classpath using following steps:-

Step 1:-

Download and install jdk( java development kit ).

Step 2:-

Set environment variable as follow -

             a) First right click on computer icon and select properties  (or you can open properties window by shortcut key "window key + pause break")



  it will open a properties window given as follow.

b) Now select Advanced system setting then select Environment Variables, it will open a pop up window for Environment Variables and then select System variable named as PATH and put the java path on it.
        i will show you the path on my system  C: Program Files Javajdk1.8.0 bin,  it may be different in your computer.

you almost done now press ok ok and ok on each pop up window and close it.

c) Now the path will be set. you can check your java path on command prompt.
  • open command prompt (directly open it by typing cmd on run (window key + r) ).
  • type "java -version" it will show your current version installed in your machine.
  • if it will not showing java version or any other message it means your path is not set properly you can again check all the steps and then try .
Now you can compile and run java code on your machine.

No comments:

Post a Comment