Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » can't open file from shell on specific Eclipse instance
can't open file from shell on specific Eclipse instance [message #1816356] Mon, 28 October 2019 11:11 Go to next message
Jerry Bib is currently offline Jerry BibFriend
Messages: 10
Registered: October 2015
Junior Member
Hi,

I have 2 same Eclipse instances running.
I want to open a file from shell, on one of them (not run new Eclipse instance!).
I can't figure out how to open the file on specific Eclipse instance.
when I'm running this:
eclipse --launcher.openFile <path/to/file>

it opens the file on my first Eclipse instance. How select the second one??
Re: can't open file from shell on specific Eclipse instance [message #1816402 is a reply to message #1816356] Tue, 29 October 2019 06:15 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30635
Registered: July 2009
Senior Member
You probably can't. I've recently been trying to understand how this is supposed to work and found this old blog to be helpful:

http://aniefer.blogspot.com/2010/05/opening-files-in-eclipse-from-command.html

I think the first Eclipse instance you run will always be the one that opens file... (Or maybe the last one you've run.) But in either case there's no way to tell the launcher which of the two already-running instances to use...
Re: can't open file from shell on specific Eclipse instance [message #1816453 is a reply to message #1816402] Tue, 29 October 2019 15:53 Go to previous messageGo to next message
Jerry Bib is currently offline Jerry BibFriend
Messages: 10
Registered: October 2015
Junior Member
I see. Thanks for the info.
I experiencing sometimes weird things even with one instance though. Sometimes, I'm trying to open a file on it and it just doesn't work, instead a new Eclipse pops.
I this case, I close my running Eclipse and open it again. Then try again to open file from shell and it works.
So this lack of robustness drives me crazy.
Did this happen to you?
Re: can't open file from shell on specific Eclipse instance [message #1816482 is a reply to message #1816453] Wed, 30 October 2019 03:12 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30635
Registered: July 2009
Senior Member
I've not found that it works reliably with the IDE itself. I have it working reliably for the installer but I'm having trouble getting the IDE itself to launch from a web link, and that uses this same mechanism as is used by the installer:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=551315

On which OS are you running?
Re: can't open file from shell on specific Eclipse instance [message #1816518 is a reply to message #1816482] Wed, 30 October 2019 11:42 Go to previous messageGo to next message
Jerry Bib is currently offline Jerry BibFriend
Messages: 10
Registered: October 2015
Junior Member
I'm using: CentOS release 6.8

I think I figure out what caused the robustness issue. Let's say I have 1 instance running and openFile works for it.
When I open 2nd Eclipse instance, the openFile command works always on the 2nd one (the latter).
If I close it (2nd), then openFile stops working at all, as if the 1st instance is invisible to it.
So as conclusion, if I close the last opened Eclipse, I must open a new one, because any previous instance is ignored.
Re: can't open file from shell on specific Eclipse instance [message #1816546 is a reply to message #1816518] Thu, 31 October 2019 03:35 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30635
Registered: July 2009
Senior Member
Thanks for sharing these details. That sort of makes sense if I think about the blog that describes how this works...
Previous Topic:convert parameter
Next Topic:eclipse -name <NAME> doesn't do effect
Goto Forum:
  


Current Time: Fri Nov 15 15:03:40 GMT 2019

Powered by FUDForum. Page generated in 0.03501 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top