Hellow World Your first java Programme
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Sameera>javac
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compile
-deprecation Output source locations where deprecat
sed
-classpath <path> Specify where to find user class files
on processors
-cp <path> Specify where to find user class files
on processors
-sourcepath <path> Specify where to find input source fil
-bootclasspath <path> Override location of bootstrap class f
-extdirs <dirs> Override location of installed extensi
-endorseddirs <dirs> Override location of endorsed standard
-proc:{none,only} Control whether annotation processing
ation is done.
-processor <class1>[,<class2>,<class3>...] Names of the annotatio
to run; bypasses default discovery process
-processorpath <path> Specify where to find annotation proce
-d <directory> Specify where to place generated class
-s <directory> Specify where to place generated sourc
-implicit:{none,class} Specify whether or not to generate cla
implicitly referenced files
-encoding <encoding> Specify character encoding used by sou
-source <release> Provide source compatibility with spec
-target <release> Generate class files for specific VM v
-version Version information
-help Print a synopsis of standard options
-Akey[=value] Options to pass to annotation processo
-X Print a synopsis of nonstandard option
-J<flag> Pass <flag> directly to the runtime sy
-Werror Terminate compilation if warnings occu @<filename> Read options and filenames from fileif you are not configured correctly you can see error massage.well lets start our first java programme.
1.first go to c drive and make folder name javaWorke or any suitable name. :P
2.then open note pad (we use note pad to create our java files you can use any text editor for this like notepad ++ or psedit or any thing you like).
3.hureeeeeeee now we are going to create our very first java programme.
just open your text editor and type like this
public class hellow{
public static void main(String args[]){
System.out.println("Hellow World");
}
}
and go to file menu select save as and name it hellow.java remember to save in class name in this programme class name is hellow if their is calss name cat we save it like cat. java
ex:-
public class cat{
public static void main(String args[]){
System.out.println("Hellow World");
}
}
we save it as cat.java
and also remember to change save as type to all files and save it. thats all.
we have to compile and run it using command prompt
go to start menu -->run box then type cmd
it will appear command prompt
now you have to reach the palce you have saved your java file hellow.java
in this case i saved it in folder name java2z .
so i have to browe it using command prompt
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Sameera>cd\
C:\>cd java2z
C:\java2z>
now we are in correct folder.
now we are going to compile our java file
to compile we use javac command.
C:\java2z>javac hellow.java
press enter
remenber to type extention .java
if you have compile successfully thier are no errors.
now we are going to run it type java and your class name
ex:-
C:\java2z>java hellow
now it will execute and give result like
hellow world
thats it.now you have done your first java programme.
we use note pad it is little bit defecult but we can use tool like netbeans,eclips or jbuilder it is very easy.
i will post netbeans post very soon
thanks for coming.
see you.
take care!
come againg!
here is a video created by me to demostrate this activity
you can download video
http://www.mediafire.com/?wlhixb4gqzcsp7aweeblylink_new_window