-
1Create a class named as Calculator.This is just an example. You can create any class you want to create.
-
2Save class Calculator as a Java file.Notice that it must be in Java format. Otherwise, it will fail to compile.
-
3Name it as Calculator.java on the desktop. Alternatively, you can save it anywhere you want.
-
4Open Plugins in the menu bar. Then choose "Show Plugin Manager".
-
5Find Nppexec and click it in the options list-box.
-
6Restart Notepad according to the instructions provided by the popup.
-
7In the menu bar, choose Plugin->Nppexec->Execute.
-
8In the command line, type: cd C:\Users\hhh\Desktop\Calculator.java, javac Calculator, java Calculator, and press enter after each command.
- The format means cd $(CURRENT_DIRECTORY) , javac $(FILE_NAME) ,java $(NAME_PART).
-
9Click OK , the program will compile and run. You can see the demonstration. It is a cool calculator, right?
How to Compile and Run Java Program by Notepad
April 19, 2019
0
Tags