I've always loved Notepad++,because of its ease of use,auto-indentation,syntax coloring and many other features,not found in the default Windows Notepad.
Today,I found an interesting technique,which allows you to Compile and Run java programs directly through Notepad++,without the need to open Command Prompt.
Follow the simple steps mentioned below:
- Download Notepad++
- I'm considering you have already downloaded java development kit(InShort: jdk).If not,download it from here
Java development Kit - Once installed,open Notepad++.Open "Plugin" menu
Plugin=>Plugin Manager=>show Plugin Manager - Find a plugin in the list,named NppExec,and click on it.Click Install button.
- Now,Go to Plugins=>NppExec,and apply the following.
- Disable or uncheck "Console command history".
- Enable "save all files on execute".
- Enable "Follow $(CURRENT_DIRECTORY)".
- Now,go to Plugins>NppExec>Execute
- Enter the following commands
cd "$(CURRENT_DIRECTORY)"
javac $(FILE_NAME) - Then choose Save..and save it with a name Compile
- Choose
option from the menu,and enter the following commands cd $(CURRENT_DIRECTORY)
java $(NAME_PART)
This time,save it with a name Run - Similarly,Save another command Compile and Run
cd $(CURRENT_DIRECTORY)
javac $(FILE_NAME)
java $(NAME_PART)
- Enter the following commands
- Now,the final step is adding these commands in our Macro menu.Go to Plugins>NppExec>Advanced options.
- Enable "Place to the Macros submenu".
- Select Compile from under the "Associated script:" menu,and click on Add/Modify button.Similarly,choose Compile from this menu,write Compile in the "Item name" field,and hit Add/Modofy button.Similarly,add the Compile and Run script.
- Hit OK button,it will ask you to Restart Notepad++.
- Restart Notepad++,open a java program,and compile it and run,using the commands under the Macro menu.
Very Useful. Thanks for the info.
ReplyDeleteWorked for me... Best article ever !! :)
ReplyDeleteThanks,glad you liked it :)
DeleteHi Manas ..am able to compile but not able to see the output .. :(
DeleteThanks Admin,
ReplyDeleteYou solved my problem.......
Thanks. It works.
ReplyDeleteCompletely confused by this step...
ReplyDeleteChoose option from the menu,and enter the following commands....
What menu?
Notepad++ 6.5.1
there is notepad++ compiler you can check it out
ReplyDeletedownlod here
Thank you,It works
ReplyDeleteIt works! Thank you.
ReplyDeleteThanks, it works as it expectated.
ReplyDeleteHello, recently I have created "Java Plugin for Notepad++" that allows you to compile and run java in Notepad++.
ReplyDeleteYou can find more information here https://github.com/dominikcebula/npp-java-plugin