Java is an object oriented language which needs a jdk to execute the program. JDK is Java Development Kit. It is available in Oracle website. User can download it freely from the website.
Based on the
operating system, the user can download jdk.
Jdk starts from
its 1.0 version to 22 now. It has many versions that are frequently updated.
How to download
jdk:
- · Just use the link given. This brings you to jdk download page.
- o Java Downloads | Oracle
- · Next, based on your operating
system, find the jdk version and download it.
- · Open the downloaded file and install
it to your system.
- · Check the path of the bin folder in
your jdk.
How to
set the path:
- · Generally, set the path of the jdk,
go for environment variable.
- · Search in the system for environment
variable.
· It shows the environment variable page. There, choose the new path option.
Enter the jdk bin folder details and click ok button.· Your path is set and your jdk is ready for executing your java program.
How to execute your java program?
- · Open a text editor like notepad.
- · Type your java program.
- · Let us create a java program to find
the sum of two numbers.
- · Here, is the program.
class sum
{
public static void main(String args[])
{
int a =10, b=20;
int s = 0;
s= a+b;
System.out.printf(“The sum of two numbers
is:%d”,s);
}
}
- · Save the file as “sum.java”.
How to
execute the java program?
- · Open the command prompt in your
system by giving cmd command in search bar.
- · Set your folder by below.
- · To compile the program, type javac
sum.java
- · To run the program, give java sum.
· It shows your output.
These are all the basic steps needed to download java and use in your system.
No comments:
Post a Comment