6 years ago (2015-05-17)  Technical application |   First to comment  32 
post score 0 times, average 0.0

Notepad++ is a computer client editor that very much likes very much. Its installation package is only 7.9M, but its function is very powerful. The interface is simple and the startup speed is fast. It is a good choice to replace the system's “notepad” with it.The functions most frequently used by guests are search/replace (support regular expressions), file transfer, and its code highlighting and code folding are also very practical. You can also change the code highlighting style theme according to your own preferences.At the same time, it has plug-in extensions, and installing plug-ins makes it infinitely possible. Notepad++ supports the following file types: C, C++, Java, C#, XML, HTML, PHP, CSS, makefile, ASCII Art (.nfo), doxygen, ini file, batch file, Javascript, ASP, VB, VBS, SQL , Objective-C, Pascal, Perl, Python, LuaTeX, TCL assembly language, Ruby, Lisp, Scheme, Properties, Diff Smalltalk. In addition to powerful editing capabilities, in fact, we can directly compile and run Java and C++ code directly in Notepad++. This way, we will not write a simple “hello world” but we will also create a new eclipse project, which can directly compile individual java files. Same as C; when editing html, you don't have to open Dreamweaver which starts very slowly.Although it does not have the powerful debugging features of a professional programmer, it is still a good tool for lightweight programming.

1. Download and install NppExec plugin

Open plug-ins separately - pluginManeger menu, click "Show Plugin Manager" to open Notepad + + plug-in management: In the available tab, find "NppExec" choose to install, restart notepad + +.

2. Press F6 to compile and run the java file

Notepad++ itself does not have a compilation function, but to call the compiled function of the JDK tool that has been registered as a system environment variable, in fact, these eclipse software is also like this, they are just editors.Compile the shortcut key is F6 first compile time, we need to set the compile command, the following is no parameter, no jar reference java file compile command

  Then save it as: "java compile" and select it directly as a template later.

3, with a parameter, java file compile command with a jar reference

Do not know whether the careful friend has found that the compile command and the command specifier above are the same as the compile and run command. All the friends who understand the command indicator compile can modify the compile command by themselves. The principle of compiling C++ is the same. The following is a java file compile command with parameters, with a jar reference:

In the above compile command, I added ";(CURRENT_DIRECTORY)/json.jar" after the -cpp(classpath) parameter "$(CURRENT_DIRECTORY)", which means that I have referenced "json.jar" in the current folder. This external jar reference.

Examples show:

Notepad++'s advanced features: compiling java, C++  

File path relationship:

Notepad++'s advanced features: compiling java, C++  


This article has been printed on copyright and is protected by copyright law. It must not be reproduced without permission.If you need to reprint, please contact the author or visit the copyright to obtain the authorization. If you feel that this article is useful to you, you can click the "Sponsoring Author" below to call the author!

Reprinted Note Source: Baiyuan's Blog>>https://wangbaiyuan.cn/en/notepad-advanced-features-compile-java-c-2.html

Post comment


No Comment


Forget password?