Downloading and Installing Java On Windows
Downloading and Installing Java On Windows
Prepared by,
Prof. T. R. Sathe
Assistant Professor
Department of CSE,
R. I. T., Rajaramnagar
1
Downloading and installing java
on windows
Prof. T. R. Sathe 2
Downloading and installing java
To begin, you need to install the JDK, which includes the Java Runtime
Environment (JRE) as well as development tools, like the Java compiler ,
interpreter and debugger.
Download the latest version of the JDK that matches your operating system.
Prof. T. R. Sathe 3
Prof. T. R. Sathe 4
Double click on downloaded jdk file to
start installation
Prof. T. R. Sathe 5
After that installation will start
Prof. T. R. Sathe 6
After installation you will have java
folder in your program files folder
Prof. T. R. Sathe 7
Set the JAVA_HOME Environment
Variable
1.Right click on This PC
2.Click on properties
Prof. T. R. Sathe 8
Click on advanced system settings
Prof. T. R. Sathe 9
In new window click on Environment
variables
Prof. T. R. Sathe 10
In system variables click on new
button
Prof. T. R. Sathe 11
Set the "Variable name" as JAVA_HOME In the "Variable
value" field, enter the path to the JDK installation
directory.
Prof. T. R. Sathe 12
Path of JDK installation directory
Prof. T. R. Sathe 13
Check JAVA_HOME variable using command
echo %JAVA_HOME% un command prompt
Prof. T. R. Sathe 14
Congratulations now you have successfully
installed java on your windows system . now let
us write and execute simple hello world java
program .
Prof. T. R. Sathe 15
Writing Your First Hello World in Java
with notepad.
1.Open notepad on your computer and type following code.
class Helloworld
{
System.out.println(“Hello World”); // prints Hello World
Prof. T. R. Sathe 16
Save this file with Helloworld.java file(Name of
class which contains main method)
Prof. T. R. Sathe 17
Now compile this file in command
prompt
Open command prompt from your PC and
change drive to the drive where you have
stored the java program ,in my example I have
stored it to D drive . Now type following
command and press enter.
Javac Helloworld.java
Prof. T. R. Sathe 18
If it is not show any error then your
program is compiled successfully
Prof. T. R. Sathe 19
Now execute program
Type following command in command prompt
Java Helloworld
Prof. T. R. Sathe 20
Program explanation
1.Class declaration:Class is declared using class key word
public class Helloworld { }
2.Main Method:It is entry point for program execution
This line declares the main method, which is the entry point of the
Java program. It's where the program starts its execution.
public static void: These modifiers indicate that the method is public
(accessible from outside the class), static (belongs to the class rather
than an instance), and returns no value (void).
Prof. T. R. Sathe 21
3.print statement
System.out.println("Hello World");
System.out.println("Hello World");: This line
prints the string "Hello World" to the screen.
The println method is part of the System.out
object
Prof. T. R. Sathe 22