How to Compile and Run Java Program in CMD Using Notepad

Computer Bits Daily
2 min readJun 16, 2021

When you will reach at the end of this Tutorial, You are able to:

  • To download and Installation JDK
  • To Setting up Java Environment for Windows PC (JAVA_HOME)
  • Understand What and Why about JAVA_HOME Environment Variable.
  • Create .java file using notepad.
  • Write a Simple java program using notepad.
  • Compile and Run Java Program using cmd.

So, let’s learn Step by Step to Run and Java Program in CMD using notepad.

Step 1:

Download JDK (Java SE Development Kit) form given Link:

https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html

Step 2:

You will get jdk-16.0.1_windows-x64_bin.exe file. Now Install JDK

Step 3:

After Installation, You have to Set Up Java path environment variable, for that

- Go to system properties in windows 10

- Go to Advanced System Settings, it will open the System Properties window.

- Select Environment Variables from the properties window. It will open the Environment Variables window.

- In Environment Variable window, Under System Variables select path and click edit. This will Open Edit Environment variable window.

- Now go to C:\ → program Files →Java — -> jdk-16.0.1 → bin

- In my case: C:\Program Files\Java\jdk-16.0.1\bin

- Copy this path and go to Environment Variable dialogue.

- In Edit Environment Variable Window click new and paste the path(C:\Program Files\Java\jdk-16.0.1\bin) we have already copied.

- Click OK

Read Full steps at : How to Compile and Run Java Program in CMD Using Notepad (computerbitsdaily.blogspot.com)

--

--

Computer Bits Daily

Learning Computer skills and Computer technology by learning and sharing