You are on page 1of 1

1. Go to Start -> Run -> Write cmd.exe -> OK 2. Change to the dir in which Java is installed (default is C: dir).

(To change dir type Directory_Name: and pree Enter) 3. cd/ 4. cd program files\java\jdk1.7.0\bin\ 5. javac File_Name.java (To Compile) 6. java File_Name (To Run the Program). (To run java program from any folder(directory) Go to Start -> Right Click on Computer -> Properties -> Advanced System Settings -> (Advanced tab) Environment Variables -> (System Variables) D ouble Click on Path -> (Variable Value) Add C:\Program Files\Java\jdk1.7.0\bin\; at the end -> OK -> OK -> OK Now just change the directory to which the java file is and simp ly compile and run it (no need to put the file in bin dir if its not using any u ser defined package))

You might also like