0% found this document useful (0 votes)
26 views11 pages

1 JDK Installation Guide

Uploaded by

Phyo Thinzar Soe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views11 pages

1 JDK Installation Guide

Uploaded by

Phyo Thinzar Soe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

For JDK 11.0.

9 (64-bit)
https://www.filehorse.com/download-java-development-kit-64/55791/
Download Java JDK 11.0.9 (64-bit)

JDK Installation
Click Next, and Next to install JDK.
After successfully installed, click the close button.
How To Add Java JDK Bin Folder To Windows Path
Right click on the computer icon in Explorer and click on Properties in the pop up menu, as
shown below.

This will display your system properties. Click on the Advanced system settings link on the left
hand side menu.

copyright@ http://tryqa.com/how-to-write-run-first-java-program-cmd-notepad/
This will open the System Properties dialog. Click on the Environment Variables button near
the bottom.

copyright@ http://tryqa.com/how-to-write-run-first-java-program-cmd-notepad/
This will open the Environment Variables dialog. The system variables are listed in the lower
group in the dialog box. If the Path variable is not visible, use the scroll bar to scroll down the
list of System variables, to bring the Path variable into view, as shown in the screenshot below.

Click on the row containing the Path variable, to select it and then click
the Edit button under System variables. If for some reason, your system does not
have a Path variable, click on the New button under System variables.

copyright@ http://tryqa.com/how-to-write-run-first-java-program-cmd-notepad/
Add the above path to the end of the variable value of Path. First we will add the
separator semicolon “;” followed by the path of the JDK binary folder as shown
below.

Then, click the Ok button on the Edit System Variable dialog, the Environment
Variables dialog and System Properties dialog.

How to Run Java Program in CMD Using Notepad


Open the notepad and write a Java program into it

copyright@ https://www.javatpoint.com/how-to-run-java-program-in-cmd-using-notepad
Save the Java program by using the class name followed by .java extension.

Only HelloWorld.java file in Demo folder.

copyright@ https://www.javatpoint.com/how-to-run-java-program-in-cmd-using-notepad
To compile and run a Java program, open the Command Prompt by pressing Windows Key +
R, type cmd and press enter key or click on the Ok button.

Check the java version, type commend: java -version

In the Command Prompt window, go inside the saved folder where we have saved the Java
program.

Type: cd Desktop\Demo

copyright@ https://www.javatpoint.com/how-to-run-java-program-in-cmd-using-notepad
Now we are inside the Demo folder where we have saved the Java program.

To compile the Java program type the following command:


Type: javac HelloWorld.java

When we compile a Java program without any error, it creates a .class file with the same name as
the file name at the same location (where the program is saved).

To run the Java program, type the following command.


Type: java HelloWorld

copyright@ https://www.javatpoint.com/how-to-run-java-program-in-cmd-using-notepad

You might also like