bmargulies
bmargulies

Reputation: 100003

How to launch eclipse from a command line on MacOS with a workspace pathname

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.

Upvotes: 11

Views: 21825

Answers (3)

Nitendra
Nitendra

Reputation: 494

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.

Upvotes: -1

zrajm
zrajm

Reputation: 1392

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.

Upvotes: -1

Fabian Steeg
Fabian Steeg

Reputation: 45684

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

Upvotes: 9

Related Questions