I am great fan of Edit+ for compiling and running java programs. But now days Edit+ is no more available for free . So I have shifted to Notepad ++ , it is powerful and easy to use editor. One of the major features of Edit+ is ease of configuring java environment to compile/run Java program, that’s missing in Notepad++.
Recently I have found out configuring Notepad Plus Plus so that one can compile and run run java program right from it. Just follow below few steps
- Locate Run option on Notepad ++ on main menu bar.
- Here we are going to use Notepad++’s environment variables . Copy following text in run dialog box
javac -classpath $(CURRENT_DIRECTORY) $(FULL_CURRENT_PATH)
- Select Save as option and then provide title “javac” and shortcut information.
After these steps , you will notice new option “javac” under “Run” menu.
This will compile current opened java class and creates .class file under same directory. Same above steps need to followed to create “java” run option to run compiled java class. Use following command string in run dialog box.
java -classpath $(CURRENT_DIRECTORY) $(NAME_PART)
References: http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Defining_User_Commands