How to Compile and Run Java Program by Notepad

Sageer SGR
0
  1. 1
    Create a class named as Calculator.This is just an example. You can create any class you want to create.
  2. 2
    Save class Calculator as a Java file.Notice that it must be in Java format. Otherwise, it will fail to compile.
  3. 3
    Name it as Calculator.java on the desktop. Alternatively, you can save it anywhere you want.
  4. 4
    Open Plugins in the menu bar. Then choose "Show Plugin Manager".
  5. 5
    Find Nppexec and click it in the options list-box.
  6. 6
    Restart Notepad according to the instructions provided by the popup.
  7. 7
    In the menu bar, choose Plugin->Nppexec->Execute.
  8. 8
    In 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).
  9. 9
    Click OK , the program will compile and run. You can see the demonstration. It is a cool calculator, right?

Post a Comment

0Comments

Post a Comment (0)