How to Compile and Run Java Program by Notepad

Create a class named as Calculator., Save class Calculator as a Java file., Name it as Calculator.java on the desktop., Open Plugins in the menu bar., Find Nppexec and click it in the options list-box. , Restart Notepad according to the instructions...

15 Steps 1 min read Advanced

Step-by-Step Guide

  1. Step 1: Create a class named as Calculator.

    This is just an example.

    You can create any class you want to create.
  2. Step 2: Save class Calculator as a Java file.

    Notice that it must be in Java format.

    Otherwise, it will fail to compile. , Alternatively, you can save it anywhere you want. , Then choose "Show Plugin Manager". ,,,, The format means cd $(CURRENT_DIRECTORY) , javac $(FILE_NAME) ,java $(NAME_PART). , You can see the demonstration.

    It is a cool calculator, right?
  3. Step 3: Name it as Calculator.java on the desktop.

  4. Step 4: Open Plugins in the menu bar.

  5. Step 5: Find Nppexec and click it in the options list-box.

  6. Step 6: Restart Notepad according to the instructions provided by the popup.

  7. Step 7: In the menu bar

  8. Step 8: choose Plugin->Nppexec->Execute.

  9. Step 9: In the command line

  10. Step 10: type: cd C:\Users\hhh\Desktop\Calculator.java

  11. Step 11: javac Calculator

  12. Step 12: java Calculator

  13. Step 13: and press enter after each command.

  14. Step 14: Click OK

  15. Step 15: the program will compile and run.

Detailed Guide

This is just an example.

You can create any class you want to create.

Notice that it must be in Java format.

Otherwise, it will fail to compile. , Alternatively, you can save it anywhere you want. , Then choose "Show Plugin Manager". ,,,, The format means cd $(CURRENT_DIRECTORY) , javac $(FILE_NAME) ,java $(NAME_PART). , You can see the demonstration.

It is a cool calculator, right?

About the Author

G

Gloria Ford

Professional writer focused on creating easy-to-follow pet care tutorials.

75 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: