Monday 10 June 2013

How to install java and run program on it

How to install and run program on java
 First you have to download java development kit I,e, jdk from http://www.oracle.com/technetwork/java/index.html  download java se (java standard edition).Then install it on ur system.Then you see there is a file name java on c:\programs files open it and u see there is two folder created name
jdk1.7.0_21
jre7(depend on ur java version)    

             Then open cmd and type

                                C:\>javac
If it gives error message then manually you have to create a path for java
After creating a path it shows like this
C:/>javac          
To create path just right click on my computer and click properties
You can see advanced system setting click on it and then click on environment variable
Then input variable name path and in place of variable value right location of bin file ie, goto c:/>program files/java/jdk/bin copy the addres it is something like C:\Program Files\Java\jdk1.7.0_21\bin
And then click on and its done. And now if you open cmd and type javac then it shows this screen.
And now its time to run a simple program in java language .
For this make a folder java or anything as per your choice in c drive ie,
 I make java folder in c drive .Then open notepad and type this program
And save as apple.java in java folder in c drive .
Now open cmd
And browse to java folder I,e,
C:/>cd java
C:/>java>
Then first compile ur program
C:/>java>javac apple.java
then it shows nothing if no error and if there is any error in code then it shows the error message after compilation type
c:/>java>java apple
then it print ur program result
I,e,
And now u have successfully installed and run program in java . If you have any doubt please leave a comment..
WITH THANKS!

No comments:

Post a Comment