Home >Development Tools >notepad >How to compile and run Java directly with Notepad++

How to compile and run Java directly with Notepad++

藏色散人
藏色散人forward
2021-06-28 16:16:108411browse

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:

How to compile and run Java directly with Notepad++# # 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:

How to compile and run Java directly with Notepad++ Click OK or return directly. The car will start compiling and executing the program:

How to compile and run Java directly with Notepad++ 6. Regarding the error when printing Chinese characters in UTF-8:

HelloWorld.java:6: 错误: 编码GBK的不可映射字符
        System.out.println("鏈?灏忓?硷細Byte.MIN_VALUE=");
The solution is to modify the above script code to:


NPP_SAVE
javac.exe -encoding UTF-8 "$(FILE_NAME)"
java.exe "$(NAME_PART)"

How to compile and run Java directly with Notepad++

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!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete