September 11, 2008

Launchy, Windows, Environment Variables etc.

Posted by Sudhindra Rao

I am working on a project that is JRuby, Javascript, Java, Maven, Ant, Rake and lots of css fun. But the even more fun part of it is that we are developing on Windows. It is really heartening to find how, Windows and application development on Windows is getting more and more annoying.

To ease the pain I introduced a few tools on Windows.

  1. ProcExp - www.sysinternals.com - is a very good task manager replacement. It is a free download and very light weight. It allows you to look at all processes(like doing a 'ps' or a 'top' on *nix) including system processes. You can kill a single process or a process tree. The benefit of looking at the tree is, you know how windows applications are spawning processes and how much memory/cpu they are eating up.
  2. Launchy for windows - Inspired by QuickSilver on the MacOSX - this is a decent application launcher. It works similar to QuickSilver is finding and launching applications. Worth a look and download if you are still a fan of 'Quick launch toolbar' and now you have run out of task bar space to add more applications to be on single click. This way you will also use the keyboard more often and take your hand off the mouse.

Now the reason I am giving a special mention to both these applications is as follows :

When you set Environment variables on Windows by navigating as follows 'My Computer ->Right Click -> Properties -> Advanced -> Environment Variables OR Control Panel -> System -> Advanced -> Environment Variables(please let me know if you can do this without touching your mouse - that would be just brilliant) - we all know that you need to restart the Command Prompt for it to be able to load these new directories that you have added to the path. Except in this situation :

When you have Launchy and if you launch command prompt through launchy. Restarting Command Prompt will not help in this case, because the command prompt that was launched by Launchy receives its context from Launchy. And if Launchy was started before you made the changes to the Environment Variables, Launchy will pass on this old context to Command Prompt. In this case you will have to restart Launchy so that the Environment Variables are updated and all the applications that are started by Launchy will have the updated Environment variables.
I could trace this because of ProcExp - as it showed the tree of processes and their parent-child relationship.

So if you have Launchy - restart Launchy after you change Environment Variables on Windows.

Another thing that I was hurt by and my colleague Chris Kozak* rightly attributed to being a windows problem is - when you add a new Environment Variable - it is not available till you restart Windows. Whosoever said that a registry was a good idea and doing it Windows style is better must have been looking at the stars.....

I am glad that I have a *nix system on my personal machine. Its just more logical.

*No developer Chris Kozaks were harmed in the making of this post.

2 comments:

Patrick said...

Opening System Properties without a mouse (Windows Key + Break). CTRL-TAB (standards windows shortcut key) scrolls forward through tabs. SHIFT-CTRL-TAB scrolls backwards.

ALT-N will trigger Environment Variables, and then the appropriate ALT-W/ALT-I/ALT-L to create/edit/delete the environment variable.

CTRL-TAB will cycle you through the focused windows so you don't have to use a mouse.

Have fun!

Sudhindra Rao said...

Thanks Patrick. I did not know the Windows + Break trick.

Welcome