- Install notepad++ and JDK (slightly);
- notepad++ menu bar: Plug-in->plugin manager->show Plugin manager,available tick nppexec, click the Install button.
- Press Fn+f6 or menu bar: Plug-in->nppexec->execute, enter the following code:
"$(FILE_NAME)"java.exe "$(NAME_PART)"
Shown
Click the Sava button, name the Java compilation plus execute, click the Sava button, click OK to close the dialog box.
4. Menu bar: Plugin->nppexec, tick follow $ (current_directory).
5. Press Fn+f6 and the following dialog box appears:
Click OK or enter directly to start compiling and executing the program:
6. Error when printing Chinese characters in UTF-8:
HelloWorld.java:6: 错误: 编码GBK的不可映射字符 System.out.println("鏈?灏忓?硷細Byte.MIN_VALUE=");
The workaround is to modify the script code above to:
NPP_SAVEjavac.exe -encoding UTF-8 "$(FILE_NAME)"java.exe "$(NAME_PART)"
Original link: notepad++ Direct compile run Java command
"Java" notepade++ how to compile and run Java files directly