Monday, December 22, 2014

Installation of Java

Installation of Java
Java Software Developement Kit(JDK) is a software created by SUN Microsystems to create or modify the java programs/applications.
We need to install JDk in our machines first. for software click here
After installing JDK we need to set the path. We can set the path in 2 ways.
1) Temparory path setting
We can set path temporarily from command prompt
C:\ set path= C:\Program Files\Java\jdk1.6_23\bin
2) Perminent Path Setting
MyComputer properties -> advanced system setting -> environmental variables -> user variables -> new -> 
variable name : path 
variable value : C:\Program Files\Java\jdk1.6_23\bin -> ok -> ok -> ok

Basic java Programm

Let us consider a java program with file name MyFirst.java
Creating Hello world program
public class MyFirst{
public static void main(String args[]){
System.out.println("Hello World..!");
}
}
to compile:
javac MyFirst.java
to execute:
java MyFirst

Output:
Hello World..!

No comments:

Post a Comment