Compile Java from Notepad++ menu (with NppExec plugin)

Ғылым және технология

Adding "Compile Java" (javac) and "Run with Java" to the Macros menu in Notepad++, using the NppExec plugin.
Assumes that JDK (Java Development Kit) is installed and is in the path, and the NppExec plugin is installed in Notepad++. Use the Plugins - Plugin Admin menu to add NppExec if you do not have it already.
Compile Script; note that the quotes are needed in case there is a space in the path:
npp_save
cd "$(CURRENT_DIRECTORY)"
javac.exe "$(FILE_NAME)"
The Run script uses NAME_PART, the filename without the extension.
cd "$(CURRENT_DIRECTORY)"
java.exe "$(NAME_PART)"
If JDK is installed but not in the path, you can add the path to javac and java in the script, e.g. C:\Program Files\Java\jdk16-0-1_181\bin\java.exe .
The scripts are tested before saving them. You can save before testing to speed up the process.
Chapters:
0:00 Intro/Contents
0:03: Run Notepad++
0:09 Open a Java file
0:22 NppExec - Execute
0:32 Add Compile Script
0:50 Test compile script
0:58 Save the script
1:16 Add script to Mecro menu
1:36 Restart to update menu
1:39 Check the .class file
1:44 Test the compile menu
1:59 Add the Run item
2:08 Enter Run script
2:23 Test run script
2:51 Add Run to menu
3:18 Restart
3:26 Test with different program
Videos on this channel are intended to support students work at the University of Westminster. They may or may not apply to your installation.

Пікірлер

    Келесі