I've found the way to compile & run Java applications from Notepad++ with just one hotkey.
First of all, go to the directory where you have installed Notepad++ and create a new file called CompileJava.bat
then open it and enter these lines (without line numbers):
-
@echo off
-
path=%path%;"<path to your BIN directory of JDK>"
-
@echo on
-
javac %1
-
java %2
-
pause
-
Save the file and exit.
After that, open Notepad++ and press F5. Fill in the box in the small window that appears with (without line number):
-
$(NPP_DIRECTORY)\CompileJava.bat $(FILE_NAME) $(NAME_PART)
-
then press the Save button, give a name to the shortcut and select the hotkey. Press Ok. Now open a java source and press the hotkey you've selected and you will see your program compiling & running!