Friday, March 25, 2011

Compiling and Running Java program from Notepad ++

 

I am great fan of Edit+ for compiling and running java programs. But now days Edit+ is no more available for free Sad smile. 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.

2011-03-25_2147

2011-03-25_2154

  • 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.

2011-03-25_2232

After these steps , you will notice new option “javac” under “Run” menu.

2011-03-25_2231

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)

 2011-03-25_2233

 

References: http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Defining_User_Commands

Friday, March 18, 2011

Capture active window using “PrntScrn”

I don’t need to tell about well known Windows’s “PrntScrn” functionality Smile. Yes, it capture current screen and you can paste that any picture editing application.  There are many efficient and more powerful screen capturing tools are available, but Window’s “PrntScrn” option is most simple option without installing any third party software.

Most of the time we need to capture only Active window rather than complete screen. I am very happy to see there is already a way to capture only active window using Fn + Alt + “PrntScrn”

 

image

Fn + Alt + PrntScrn

Ctrl + V in Paint application

image

You can notice , only current active window gets captured ( pasted in Paint application).