10

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
  • 94,623
  • 39
  • 172
  • 299

4 Answers4

8

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

Fabian Steeg
  • 44,009
  • 7
  • 83
  • 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
0

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,630
  • 4
  • 31
  • 45
zrajm
  • 1,267
  • 1
  • 12
  • 21
0

On my Mac running High Sierra the Eclipse Binary was located in /Users/<username>/eclipse/<tool-chain-version>/Eclipse.app/Contents/MacOS/

Where the tool-chain-version is the specific version of Eclipse that was installed, in my case it was javascript-2018-12. I believe they follow this pattern, for example j2ee-2019-01.

Running the eclipse binary in that directory starts eclipse from the command line.

Jason D
  • 7,485
  • 9
  • 33
  • 38
0

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
  • 476
  • 4
  • 14