Home > Development Tools > notepad > body text

How to compile and run Java directly with Notepad++

藏色散人
Release: 2021-06-28 16:17:18
forward
8230 people have browsed it

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)"
Copy after login

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=");
Copy after login

The solution is to modify the above script code to:


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

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!