Lets have a Quick Starting to "JAVA" :
In this article, I am going to show you how to Set Up your PC before running java programs.
Download JDK according to your operating system from below link & install it:
(I have installed jdk6. Latest is jdk7.)
On successfully Installing, You will find jdk1.6.0_17 and jre6 folders at location C:\Program Files\Java (this may very according to operating system)
(In this post,all example of path and locations etc all are basically according to windows group operating systems.Other Operating systems will have a little change only.)
Now Open CMD (Command Prompt).
Write down javac and press Enter
It will show bellow error :
'javac' is not recognized as an internal or external command,
operable program or batch file.
Same applicable for java command.
This means that you have installed java using jdk, but still javac and java are not recognized command.
Now, To solve this error, You have to set the path.
You are supposed to set path up-to bin folder.
ie. write following command and press enter.
set path=C:\Program Files\Java\jdk1.6.0_17\bin;
(Location of bin may very according to your operating system)
and then again type javac and java you will get some help files as shown below :
Congratulations !!!
It means You have configured your command prompt to run your java program !
BUT WAIT.....
Close Command Prompt and again open and again type javac or java
HA HA HA...
again not recognized command ...
It means you have to set path each & every time you open "CMD" !!!
Don't worry here is solution:
- Go to System Properties,
- Advanced tab,
- Environment variables,
- choose Path from System variables, click Edit Bellow,
- One dialog box will appear in which already path value is there, keep it as it is,
- add semicolon(;) to existing path value and append our path(C:\Program Files\Java\jdk1.6.0_17\bin;) in the value.
- Now close CMD and again open CMD type javac and java they are now recognized command.
- So you no need to set path each & every time.
Now you are ready to become java programmer !
No comments:
Post a Comment