notepad(Notepad) is a code editor and a program in the Windows operating system. It is used for text editing. In terms of text editing, it is similar to Windows WordPad and Office. Functionality is equivalent. It is an open source, compact and free plain text editor.
How to compile and run Java directly with Notepad?
1. Install Notepad and JDK (omitted);
2. Notepad’s menu bar: Plug-in->Plugin Manager->Show Plugin Manager, check NppExec in Available, and click Install button.
3. Press F6 or the menu bar: Plug-in->NppExec->Execute, enter the following code:
NPP_SAVE javac.exe "$(FILE_NAME)" java.exe "$(NAME_PART)"
As shown in the picture:
# # Click the Sava button, name it Java Compile and Execute, click the Sava button, and click OK to close the dialog box.
4. Menu bar: Plug-in->NppExec, check Follow $(CURRENT_DIRECTORY).
5. Press F6, the following dialog box will appear:
Click OK or return directly. The car will start compiling and executing the program:
6. Regarding the error when printing Chinese characters in UTF-8:
HelloWorld.java:6: 错误: 编码GBK的不可映射字符 System.out.println("鏈?灏忓?硷細Byte.MIN_VALUE=");
NPP_SAVE javac.exe -encoding UTF-8 "$(FILE_NAME)" java.exe "$(NAME_PART)"
The above is the detailed content of How to compile and run Java directly with Notepad++. For more information, please follow other related articles on the PHP Chinese website!