03 December 2013

How to Add Javac to Compile Java code in Windows

java logo

To compile java code in command promt , you need to register the java variable to the windows Environment variable .

Follow the step below :

system properties
Step 1
On desktop , Right Click on My Computer->Properties.
Choose the tab Advanced->Environment Variables

Under "User variables for user", if there is no variable named "path"
then add it by clicking "New".
Enter Variable name : path
Enter Variable Value : C:\Program Files\Java\jdk1.6.0_10\bin;

(Note : it will vary on different computer as your java may be of different version)

Click OK.
environment variable
Step 2

To test , Go to Start->run.
Write "cmd" and click OK.

On the command line , type "javac" and press enter.
you will find something like this .

Success !.
Step 5

(If you found this article useful then share with your friends.)

No comments: