You can not run java program using notepad. However you can use command prompt if dont intend to use IDE.

e.g.

javac yourFileName.java // It will create .class file
java yourFileName       // It will run your program and will show output/errors
Answer from AbhiN on Stack Overflow
๐ŸŒ
Javatpoint
javatpoint.com โ€บ how-to-run-java-program-in-cmd-using-notepad
How to Run Java Program in CMD Using Notepad - javatpoint
How to Run Java Program in CMD Using Notepad with java tutorial, features, history, variables, object, class, programs, operators, for-loop, oops concept, array, string, map, math, methods, examples etc.
๐ŸŒ
Notepad++ Community
community.notepad-plus-plus.org โ€บ topic โ€บ 21682 โ€บ how-to-run-java-applications-in-notebook-version-7-9
How to run Java applications in Notebook++ version 7.9 | Notepad++ Community
February 26, 2025 - At that time, I had created a java-compile and java-compile-and-run script for NppExec: ... NPP_SAVE cd "$(CURRENT_DIRECTORY)" javac "$(FILE_NAME)" java -classpath "$(CURRENT_DIRECTORY)" "$(NAME_PART)" You will notice that I do slightly more than just run javac: first I make sure the file is saved (otherwise javac will see the last-saved version, which might not match what I have open in Notepad++ if Iโ€™ve forgotten to save first); second, I change into the same directory that the .java file is saved in (NppExec doesnโ€™t guarantee it will set up its environment in the same folder); then third, I use javac to compile the .java source code.
๐ŸŒ
W3Schools
w3schools.com โ€บ java โ€บ java_getstarted.asp
Java Getting Started
Open Command Prompt (cmd.exe), navigate to the directory where you saved your file, and type "javac Main.java": ... This will compile your code. If there are no errors in the code, the command prompt will take you to the next line.
๐ŸŒ
Wikihow
wikihow.com โ€บ computers and electronics โ€บ software โ€บ programming โ€บ java โ€บ how to compile and run java programs using notepad++
How to Compile and Run Java Programs Using Notepad++
June 5, 2025 - Change your computer's environment variables to allow for creating and running Java. Write Java code in Notepad++, save it as a Java file, then launch the NppExec plugin. ... Make sure you have the latest version of Java SDK and Jave RTE.
๐ŸŒ
Scaler
scaler.com โ€บ home โ€บ topics โ€บ how to run java program?
How to Run Java Program? - Scaler Topics
March 22, 2024 - Step 2: You can see that inside the Art folder, there is a Java file named test.java. Step 3: Now press Alt+D, and you will enter the above search bar. Step 4: Type CMD and press enter key.
Find elsewhere
๐ŸŒ
Quora
quora.com โ€บ How-do-I-compile-and-execute-Java-code-from-notepad-Windows-10-Java-17-beginner-exploring-Java
How to compile and execute Java code from notepad - Quora
Answer (1 of 4): Notepad cannot compile Java code. While simple text editors like Notepad are fine for writing very short programs like what you are likely writing at this stage, as you get more experienced you will want to start looking at ...
๐ŸŒ
YouTube
youtube.com โ€บ my how to code school
Learn How to Run a Java Program using Notepad and Command Prompt - YouTube
We can compile and run Java Programs ( with user defined Packages ) from command prompt ( CMD ) in Windows 11 Computer and this video tutorials teaches you t...
Published ย  August 4, 2024
Views ย  176
๐ŸŒ
Wikihow
wikihow.com โ€บ computers and electronics โ€บ software โ€บ programming โ€บ java โ€บ how to compile and run a java program using command prompt
How to Compile and Run a Java Program Using Command Prompt
September 28, 2025 - Type "java [filename]" and press "Enter" to run the Java program after it is compiled. ... Save the program. You can create a Java program using a simple text editing program like Notepad or an independent development environment (IDE) such ...
๐ŸŒ
Colorado State University
cs.colostate.edu โ€บ helpdocs โ€บ JavaInDOS.html
How to run Java Applets and Applications in DOS
For PCs running Windows NT (as in the Weber Lab), choose Start/Programs/Command Prompt from the Windows NT desktop. For PCs running Windows 95, choose Start/Shut Down/Restart in MS-DOS Mode from the Windows 95 desktop. Now, change to the directory of your choice from within the command window. For example: Create some Java source code with Notepad from within the command window.
๐ŸŒ
YouTube
youtube.com โ€บ watch
First Java Program in Notepad | Run Java Program in CMD in Hindi - Tutorial #5 - YouTube
In this video, we will take a look at how to write our first program in java to print some message on the output screen. We will write our code in notepad an...
Published ย  March 12, 2021
๐ŸŒ
Computerbitsdaily
computerbitsdaily.com โ€บ home โ€บ java using notepad โ€บ how to compile and run java program in cmd using notepad
How to Compile and Run Java Program in CMD Using Notepad
June 16, 2021 - Or Eclipse may prompt Error: Eclipse launch error no Java home found ... Now, We need to Check Java JDK is installed properly or not using CMD. ... Open Notepad and create file with .java extension.
๐ŸŒ
Refreshjava
refreshjava.com โ€บ java โ€บ my-first-java-program
First Java Program - How to compile and run java program - RefreshJava
To compile a program in java execute the command - javac YourClassName.java - and to run your program execute the command - java YourClassName.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ how-to-run-java-program
How to Run Java Program? - GeeksforGeeks
July 23, 2025 - Step 5: Compile your Java code by typing "javac [filename].java" in the command prompt/terminal. This will create a .class file in the same directory. Step 6: Run your Java program by typing "java [filename]" in the command prompt/terminal.
๐ŸŒ
YouTube
youtube.com โ€บ watch
how to compile and execute java program - YouTube
#techlearners #java #compileThe tutorial is about, how to compile and execute java program. To write java program notepad is used as editor. To compile javac...
Published ย  June 25, 2019
๐ŸŒ
Instructables
instructables.com โ€บ circuits โ€บ computers
Use Notepad and Command Prompt for Java Programming - Instructables
October 9, 2017 - Use Notepad and Command Prompt for Java Programming: Hello, in this instructable, I will show you how to create, and execute a program that you created in java using notepad. You will need to open some things: -Notepad -Command Prompt
๐ŸŒ
Brainly
brainly.in โ€บ computer science โ€บ secondary school
How to run java program in notepad and cmd - Brainly.in
February 19, 2023 - Go to the folder, and make the new Java file in that folder. Press Alt+D, and just type Notepad there. Notepad will open, now paste the java code given below in the Notepad and save it with extension java.