Issue
I have Eclipse already running, and I want to be able to open a file and jump to a line number from CLI.
I want the file to open in the current open workspace. I am trying this:
/Applications/Eclipse.app/Contents/MacOS/eclipse --launcher.openFile test_file.c:401
However, I am getting an error because the default workspace is already open, and its asking me to choose another workspace.
if I simply use open text_file.c
it works just fine, but doesn't jump to the line number of course.
Edit: Even after starting in a new session, and removing the line number, Eclipse doesn't open the file. It only opens the application (Eclipse).
however if I use open -a eclipse filename
the file opens successfully
Solution
Thanks to Lili for the correction:
- Opening a file in the same workspace via command line does not work on mac, bug1
- Opening a file/linenumber in eclipse is not supported
Answered By - Shadi