Sunday, January 23, 2011

Welcome to java curb

Hello friends..The main objective of this blog is to keep u update regarding java coding...
I will try to give answers off all our questions and will try to do all sorts of java related coding here..
So herez my first step..
NOTE: This is a begginners tutorial for learning java..
Step 1:
Install java with latest version..I am using JDK 1.6.0_13 and jre6
Directory for your java installation is
C:\Program Files\java

After installation u have to put a path to run your java programs in your JVM(Java Virtual Machine)

Path is:
1] Right click on My Computer->Advanced->Environment Variables->There u will see User variables and system variables->on user variables click edit->Give variable name[PATH] and varable path[C:\Program Files\java\jdk\bin]->Apply your settings


To check that the java path is correct follow these steps:
1]Open ms-dos
2]write javac and press enter
3]If a long list comes then your java programs can be easily compiled on JVM
4]If on pressing enter the following message occurs "javac is not an internal command" then you have to set your path again


Now if java has started running on your computer you have to follow these steps to write your first code using JAVA
1]Open notepad
2]write following line of code or copy this code
class Demo{
public static void main(String [] args)
{
System.out.println("Hello World!!");
}
}


Save this program:Use following convention if having problem in running your pgm
D:/JavaPrograms/Demo.java
To run follow these steps:
1]Open MS-DOS to see the output
2]write[javac Demo.java]
3]then press enter
4]then write[java Demo]

No comments:

Post a Comment