Take the 2-minute tour ×

Goal: Under OSX, From the command line, open a file in eclipse.


OSX 10.7 Eclipse Indigo Java EE bundle (3.7.1)


  1. cd to directory eclipse is installed from.
  2. run: ./eclipse --launcher.openFile notice.html
  3. Eclipse opens with the file 'notice.html' open/editable

What happens:

Eclipse opens but the file isn't loaded. :(

I explicitly want to do this from the command line, I'm NOT interested in opening the file via Finder->Open With->Choose Eclipse.app

Here is an article that seems to indicate that I should be able to do this: http://aniefer.blogspot.com/2010/05/opening-files-in-eclipse-from-command.html

If there is another way to communicate with an already open eclipse to open a file that would be acceptable as well.

Eventually I'd like to use:

open //path-to-Eclipse.app --args --launcher.openFile //path-to-file

...to communicate my desire for the file to open in the current instance of the running eclipse.

But for now I'm just trying to see if there is ANY way to open a file

Anyone have any ideas?

Thanks in advance for any help/pointers :)

share|improve this question
If Eclipse is a well-behaved application under OS X, you should be able to: open -a Eclipse /path/to/file –  Bavarious Nov 6 '11 at 0:54
add comment

closed as off topic by Jonathan Sampson Nov 7 '11 at 0:09


1 Answer

I agree with Bavarious. I always use open -a to open a specific file in a GUI app from the command line.

share|improve this answer
add comment
