Skip to main content



      Home
Home » Newcomers » Newcomers » open file in existing Eclipse instance
open file in existing Eclipse instance [message #246809] Fri, 25 January 2008 08:52 Go to next message
Eclipse UserFriend
Originally posted by: dsvick.gmail.com

I've looked and can not find an answer to my question, of course there are
a number of different ways to ask it, so if there is an answer or
discussion that already exists - just give me a shove in the right
direction.

I've got eclipse installed and everything is fine so far except that
whenever I want to open a new file in Eclipse from my file system (windows
explorer) it tries to open it in a new instance of Eclipse. I'm not
running multiple work spaces (no need to do so) so I end up either
dragging the file to the currently running Eclipse or opening it through
the open dialog in Eclipse. I've checked the preferences and can't find a
setting to tell Eclipse to open new files in a current instance.

Any help would be appreciated

thanks

Dave
Re: open file in existing Eclipse instance [message #246814 is a reply to message #246809] Fri, 25 January 2008 09:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Dave wrote:
> I've looked and can not find an answer to my question, of course there
> are a number of different ways to ask it, so if there is an answer or
> discussion that already exists - just give me a shove in the right
> direction.
>
> I've got eclipse installed and everything is fine so far except that
> whenever I want to open a new file in Eclipse from my file system
> (windows explorer) it tries to open it in a new instance of Eclipse. I'm
> not running multiple work spaces (no need to do so) so I end up either
> dragging the file to the currently running Eclipse or opening it through
> the open dialog in Eclipse. I've checked the preferences and can't find
> a setting to tell Eclipse to open new files in a current instance.

That is not a supported use case.
Eclipse is fundamentally project-oriented; everything it works on really
needs to be in a project in order for Eclipse to have the context
necessary for parsing, compiling, and indexing the file as a Java code
artifact.
There is a File > Open menu item that allows you to open a single file
outside the workspace, but that is not a very useful thing to do for
Java source files because they don't have any project context.
What would you expect Eclipse to do if you double-click an arbitrary
Java file from your file explorer - what project should it associate
that code with? Where does all the necessary context come from? All it
can really do without making lots of assumptions would be to open it in
a simple text editor, which IMO isn't a very useful thing to do.

BTW, this has been asked many times before but the answer has been the
same all along.

Eric
Re: open file in existing Eclipse instance [message #246824 is a reply to message #246814] Fri, 25 January 2008 09:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Eric Rizzo wrote:
> Dave wrote:
>> I've looked and can not find an answer to my question, of course there
>> are a number of different ways to ask it, so if there is an answer or
>> discussion that already exists - just give me a shove in the right
>> direction.
>>
>> I've got eclipse installed and everything is fine so far except that
>> whenever I want to open a new file in Eclipse from my file system
>> (windows explorer) it tries to open it in a new instance of Eclipse.
>> I'm not running multiple work spaces (no need to do so) so I end up
>> either dragging the file to the currently running Eclipse or opening
>> it through the open dialog in Eclipse. I've checked the preferences
>> and can't find a setting to tell Eclipse to open new files in a
>> current instance.
>
> That is not a supported use case.
> Eclipse is fundamentally project-oriented; everything it works on really
> needs to be in a project in order for Eclipse to have the context
> necessary for parsing, compiling, and indexing the file as a Java code
> artifact.
> There is a File > Open menu item that allows you to open a single file
> outside the workspace, but that is not a very useful thing to do for
> Java source files because they don't have any project context.
> What would you expect Eclipse to do if you double-click an arbitrary
> Java file from your file explorer - what project should it associate
> that code with? Where does all the necessary context come from? All it
> can really do without making lots of assumptions would be to open it in
> a simple text editor, which IMO isn't a very useful thing to do.
>
> BTW, this has been asked many times before but the answer has been the
> same all along.

Here's the (very old) Bugzilla report with much discussion:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=4922
Note that many people commenting there haven't taken the time to
understand the complexity of the problem (part of which I tried to
explain above). Possibly the work of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=178927 will lead to
something useful, but in the end I doubt it without more community
contributions other than just complaints.

Eric
Re: open file in existing Eclipse instance [message #246881 is a reply to message #246814] Fri, 25 January 2008 15:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com

In article <fncrd7$itn$1@build.eclipse.org>, eclipse-news@rizzoweb.com
says...

....

> There is a File > Open menu item that allows you to open a single file
> outside the workspace, but that is not a very useful thing to do for
> Java source files because they don't have any project context.
> What would you expect Eclipse to do if you double-click an arbitrary
> Java file from your file explorer - what project should it associate
> that code with? Where does all the necessary context come from? All it
> can really do without making lots of assumptions would be to open it in
> a simple text editor, which IMO isn't a very useful thing to do.

Why not? I have certainly had a use for this, when a java file is
either standalone, or associated with a non-eclipse project, or I just
want to look at some sample code that I downloaded from the web.

.....

--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
Re: open file in existing Eclipse instance [message #246890 is a reply to message #246881] Fri, 25 January 2008 16:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

ns_dkerber@ns_WarrenRogersAssociates.com wrote:
> In article <fncrd7$itn$1@build.eclipse.org>, eclipse-news@rizzoweb.com
> says...
>
> ...
>
>> There is a File > Open menu item that allows you to open a single file
>> outside the workspace, but that is not a very useful thing to do for
>> Java source files because they don't have any project context.
>> What would you expect Eclipse to do if you double-click an arbitrary
>> Java file from your file explorer - what project should it associate
>> that code with? Where does all the necessary context come from? All it
>> can really do without making lots of assumptions would be to open it in
>> a simple text editor, which IMO isn't a very useful thing to do.
>
> Why not? I have certainly had a use for this, when a java file is
> either standalone, or associated with a non-eclipse project, or I just
> want to look at some sample code that I downloaded from the web.

As I said, IMO. Obviously other people have different opinions.
There is, of course, File > Open...
Anecdotally, I find that I do very little in the Windoze File Explorer
with code files. The Eclipse Navigator, limited as it is, is good enough
for manipulating code files and I keep a "Sandbox" project in all my
workspaces specifically for the purpose of examining code such as
samples or experiments.

The beauty of Eclipse as a community is that we are each able to voice
our opinions and desires, and they actually have an effect - comment
and/or vote on the Bugzillas if you're so inclined; and as I said, I'm
sure code contributions would be more than welcomed since most of the
committers are usually overbooked with work and this has been a thorny
problem for quite a while.

Eric
Re: open file in existing Eclipse instance [message #246915 is a reply to message #246890] Fri, 25 January 2008 21:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dsvick.gmail.com

Thanks for the replies, I sort of figured that that would be the response
and the reason behind it too. I can see both sides of the fence in this
and have to fall into the one where there would be need to do what I asked
for. In a project environment I can understand the lack of it and it makes
sense then too.

My needs though is to open a lot of single files that may or may not be
associated with a project. I guess I wont be uninstalling Crimson Editor
any time soon then and I'll just stick with Eclipse for projects.

Thanks again for you responses
Re: open file in existing Eclipse instance [message #247092 is a reply to message #246915] Tue, 29 January 2008 11:37 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Dave wrote:
> Thanks for the replies, I sort of figured that that would be the
> response and the reason behind it too. I can see both sides of the fence
> in this and have to fall into the one where there would be need to do
> what I asked for. In a project environment I can understand the lack of
> it and it makes sense then too.
>
> My needs though is to open a lot of single files that may or may not be
> associated with a project. I guess I wont be uninstalling Crimson Editor
> any time soon then and I'll just stick with Eclipse for projects.
>
> Thanks again for you responses
>

Here's a little elaboration on the Sandbox "trick" that I use:
I always have a Java project in my workspaces named Sandbox and I can
drop whatever "temporary" code I want to examine or play with in there.
To go a little further, you can set up a linked folder in that project
to point to a location where you like to dump sample code; then if you,
for example, download some sample code into that location on your file
system, all you have to do is jump back to Eclipse, Refresh the project
(right-click menu), and you'll see the file(s) you just dumped in there.

I understand this is a work-around, but it is better than nothing and
faster than trying to contribute solutions to the larger request of
file-explorer integration.

Hope this helps,
Eric
Previous Topic:Question on XwingML or XUL equivalent
Next Topic:Will Eclipse run on Mac OS X 10.2.8?
Goto Forum:
  


Current Time: Wed Jul 23 02:43:05 EDT 2025

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

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

Back to the top