Compile and Run Programs from a Text Editor or IDE
You can compile and run programs using command prompts with help of command environment tools or using IDEs.
To run with command prompts we need first set path environment variable for java command environment tools.
To run and compile with IDEs we need set JAVA_HOME environment variable .
To set path
Open the properties of "My Computer Open a window named "System Properties"
Click on the "Advanced" tab Then
click "Environment Variables" Next,
another window opens Double-click on the "Path" variable on either of the option boxes.
Donít delete anything in this box.
At the end of the text box, add a semi-colon & add "; C:\Program Files\Java\jdk1.5.0_10\bin" to the text box.
Click "Apply" and "OK" to all the windows you have just opened.
Open the new command prompt again,
To check open cmd and type javac and press enter C:\ >javac
Then Following will display .