I can run eclipse -clean
on my PC, but on my Mac, the executable is Eclipse.app -- how do you run that with arguments on the command-line?
Here is a script using macports to automate the restart. You can put this script e.g. on your desktop to be able to double click it.
#!/bin/bash
# WF 2014-03-14
# start Eclipse cleanly
pgrep -fl Eclipse.app
if [ $? -eq 0 ]
then
echo "Eclipse is running - shall i kill and restart it with -clean? y/n?"
read answer
case $answer in
y|Y) ;;
*) echo "ok - I'm aborting this ..."
exit 1;
;;
esac
echo "killing current eclipse"
pkill -f Eclipse.app
fi
echo "starting eclipse cleanly ..."
/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse -clean -clearPersistedState&