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...
Step-by-Step Guide
-
Step 1: Create a class named as Calculator.
This is just an example.
You can create any class you want to create. -
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? -
Step 3: Name it as Calculator.java on the desktop.
-
Step 4: Open Plugins in the menu bar.
-
Step 5: Find Nppexec and click it in the options list-box.
-
Step 6: Restart Notepad according to the instructions provided by the popup.
-
Step 7: In the menu bar
-
Step 8: choose Plugin->Nppexec->Execute.
-
Step 9: In the command line
-
Step 10: type: cd C:\Users\hhh\Desktop\Calculator.java
-
Step 11: javac Calculator
-
Step 12: java Calculator
-
Step 13: and press enter after each command.
-
Step 14: Click OK
-
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
Gloria Ford
Professional writer focused on creating easy-to-follow pet care tutorials.
Rate This Guide
How helpful was this guide? Click to rate: