Procedure Set Path And Run Java Programs In Windows 7 & Windows 8 Using Cmd
- Download Java JDK zip and extract it. Copy it and paste in "C:\Program Files (x86)\Java\" folder of your computer system.
- Go to Local Disk D or E and create a directory (Folder) Ex: Techies Net
- Write all the java programs in the folder created with .java as an extension.
- Always remember to save the program with same name as that of class name which include the main function block.
- To set path of java follow the navigation: MyComputer Properties → Advanced Setting → Environment Variables → click edit path in sytem variables. There at the end of the path add this - ;C:\Program Files (x86)\Java\jdk1.6.0_20\bin
- Later open command prompt using Run and type the following code to execute java program:
D:\>cd Techies Net
D:\Techies Net>javac cyberfreewishes.java //Compile Command
D:\Techies Net>java cyberfreewishes //Run Command
Welcome To The Techies Net Website //Output
Note: Program Files (x86) is only for Win 7 or 8. For Windows XP, it is just Program Files.
How To Set Path For Java - Video Tutorial
Share This Post