Run Eclipse from the Command Line on OS X

If you’re looking to launch Eclipse passing in the -clean parameter on OS X you’ll want to cd into the eclipse directory that contains your Eclipse.app package and use the following syntax in bash or your favorite shell terminal:

./eclipse -clean -vmargs -XstartOnFirstThread

The arguments following ./eclipse are all passed to Eclipse and the arguments following -vmargs are passed to the Java jvm.

run Eclipse on OS X from commandline

As an alternative you can modify the Eclipse ini file (see image below for ini location). If you alter the ini file, the arguments set there will be passed in each time Eclipse is run as opposed to a one time deal with the command line.

Eclipse ini location

Why would you want to use the -clean argument? According to the documentation the -clean argument provides the following:

Cleans cached data used by the OSGi framework and Eclipse runtime. Try to run Eclipse once with this option if you observe startup errors after install, update, or using a shared configuration.

Newly installed plugins will often not work until Eclipse has been run with the -clean parameter. After a good chunk of time the Eclipse workspace may also become corrupt and -clean can sometimes work wonders. If you’re having Eclipse workspace issues check out Riyad Kalla’s excellent article.

Finally, if you’re like me and have hard time remembering where in the Eclipse help documentation you kind find all of the Eclipse startup arguments and their uses the Jing screengrab below should help.

Eclipse startup arguments / parameters

Killer Regular Expressions Tool

I’ve always viewed regular expressions as some sort of nasty dark art that only a Perl developer could love, but today I picked up on a tool, RegexBuddy, that promises to make me fear regex no longer. This gem fell to me by virtue of one of the many dev mailing lists I skulk on–osflash.org, courtesy of a thread started by John Grden and answered by Antony Jones. There are a couple of caveats here–1) this is a windows only app (thankfully Parallels / Crossover help mitigate this) and 2) This is not a free app (runs $30 US).

osflash thread screen capture

ROCKS indeed Antony!

*UPDATE*

Thankfully, RegexBuddy works with Crossover:

Image of Crossover running RegexBuddy on Mac OS X