Launching Multiple Instances of Eclipse

I've been a fan of Eclipse for a long time now, even before FDT and Flash Builder were built around it. The use of workspaces, once you get your head around them, is powerful for focusing your head on the work at hand, keeping all associated projects within the one space.

However there are times when I wish I was able to have multiple workspaces open. And too the rescue comes the command line.

[Path/To/Eclipse]/eclipse -data [Your/Workspace/Dir] &

I've wrapped this up into a little bash script to start eclipse from either the current directory or using the specified directory as the workspace:

  1. #!/bin/sh
  2. if [ -n "$1" ]; then
  3. echo "Starting eclipse: WORKSPACE: " $1
  4. /Applications/eclipse/eclipse -data $1 &
  5. else
  6. echo "Starting eclipse: WORKSPACE: " `pwd`
  7. /Applications/eclipse/eclipse -data `pwd` &
  8. fi

On OSX it's better to use the open command, like:

  1. #!/bin/sh
  2. if [ -n "$1" ]; then
  3. echo "Starting eclipse: WORKSPACE: " $1
  4. open -n /Applications/eclipse/Eclipse.app --args -data $1
  5. else
  6. echo "Starting eclipse: WORKSPACE: " `pwd`
  7. open -n /Applications/eclipse/Eclipse.app --args -data `pwd`
  8. fi

This will work equally as well with the Flash Builder application, just replace the Eclipse.app with the path to Flash Builder.

Happy workspacing!

Published by

Michael

http://michaelarchbold.com

Leave a Reply

Your email address will not be published. Required fields are marked *