11

On linux:

eclipse PathnameToWorkspace

works fine, and launches eclipse on the workspace.

I've never been able to figure out the MacOS moral equivalent, given the MacOS application tree structure.

I suspect this is not a hard problem.

bmargulies
  • 97,814
  • 39
  • 186
  • 310

3 Answers3

9

./eclipse -data <workspace-path> (see also How do I run Eclipse in the Eclipse Wiki).

Fabian Steeg
  • 44,988
  • 7
  • 85
  • 112
  • 9
    On MacOS, the 'eclipse' in the root is a symlink which points to 'Eclipse.app/Contents/MacOS/eclipse'. If that symlink doesn't exist, you can create your own or just use that relative path on the command line. – Andrew Niefer Nov 23 '09 at 15:52
-1

On my system there's a link to the eclipse binary from /Applications/eclipse/eclipse, and I find that just running that will start Eclipse with my default workspace.

You might also find the Eclipse binary in '/Applications/Eclipse.app/Contents/MacOS/eclipse'.

When I start Eclipse like this (from the command line) I find that my Mac will not always switch to the desktop where Eclipse is started, so that I will have to go hunt for the Eclipse window with Exposé/Misson Control (Ctrl-Up Arrow). – This is especially true when I'm have two monitors connected to my Mac.

Since I found typing the full path to eclipse annoying, I simply added a symlink to it from /opt/local/bin and made sure that directory is in my $PATH:

cd /opt/local/bin
sudo ln -s /Applications/eclipse/eclipse .
echo 'PATH="$PATH:/opt/local/bin' >>~/.bashrc

After that, just issuing the command eclipse (without the preceding /Applications/eclipse part) works as it should.

Craig S. Anderson
  • 6,966
  • 4
  • 33
  • 46
zrajm
  • 1,361
  • 1
  • 12
  • 21
-1

After doing lots of hit and try I have added following into my bash_profile and I am able to launch eclipse from terminal.

(Note: Eclipse is inside Application)

export PATH="$PATH:/Applications/Eclipse.app/Contents/MacOS"

Hope it will be helpful for beginner like me.

Nitendra
  • 484
  • 4
  • 17