Home >Development Tools >notepad >How to run code in notepad
How does notepad run code? Take JAVA as an example below:
Toolbar->Run, click and select "Run".
1. In the run window, enter:
cmd /k javac "$(FULL_CURRENT_PATH)" & echo 编译成功! & PAUSE & EXIT
After clicking save, set the name in the pop-up window: name it "JAVA Compilation".
2. Repeat the above steps and add a method to run JAVA.
Input in the running window:
cmd /k java -cp "$(CURRENT_DIRECTORY)" "$(NAME_PART)" & PAUSE & EXIT
Related recommendations: "Notepad using graphic tutorial"
After clicking save, in the pop-up window Set name: Name it "JAVA Run".
After the addition is successful, it will be displayed under the run menu:
Open the .java file and click "Compile JAVA", successful Then click "Run JAVA" to call the CMD command to run the JAVA code.
It is troublesome to click and run manually. You can set shortcut keys to compile JAVA: Alt Shift B; to run JAVA: Alt Shift R.
The above is the detailed content of How to run code in notepad. For more information, please follow other related articles on the PHP Chinese website!