Bug 7289 - Running multiple instances of Eclipse
Summary: Running multiple instances of Eclipse
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 1.0   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: DJ Houghton CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 21589 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-01-04 19:20 EST by OTI Support CLA
Modified: 2002-07-15 16:39 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description OTI Support CLA 2002-01-04 19:20:27 EST
It is possible to run multiple instances of Eclipse 1.0. A fix was created for 
builds after Oct 4 2001:

JohnA (10/2/2001 5:09:32 PM)
Fixed.  Solution was to create a lock file, and open a file handle using 
java.io.RandomAccessFile. Then, the second instance tries to delete the file, 
and does not succeed because the other instance has the file open.  This works 
and has been tested on WinNT, both NTFS and FAT32.  I suspect this may not work 
on Linux.   Fix in builds >202.

I believe this will not work on Linux. A possible alternative is to test whether 
a file exists or not (like VAJava's busy.sav file). If you're the first 
instance, you create the file; if you're the second instance, you detect it and 
refuse to start up. The first instance must also delete the file at exit. This 
should work on both Linux/Unix and Windows.

-> if the file exists when you start, you should prompt with a nasty dialog: "It 
looks as if Eclipse is already running here. If it is, you could be shooting 
yourself in the foot. Do you really want to start?" just in case the last time 
Eclipse ran it terminated unexpectedly and was unable to delete the file.
Comment 1 John Arthorne CLA 2002-01-07 10:41:56 EST
We explored that option, but popping up a dialog is not possible until after 
the runtime startup process is over, which is too late.  Besides, having such a 
dialog pop up really isn't very nice.  It was possible to print the nasty 
message to the console, but the console usually isn't visible in a typical user 
configuration so this doesn't help.

The current approach is really the best we could come up with.  It was felt to 
be more important to have the protection on Windows, as Linux users are more 
accustomed to an environment that generally just lets you shoot yourself in the 
foot.
Comment 2 John Arthorne CLA 2002-01-16 15:23:22 EST
Won't fix.
Comment 3 Paula Cox (WSAD) CLA 2002-02-15 14:31:54 EST
I tested this fix on the Rollup 2 on Release 1.0 on Windows, and it looks
like we stop the user from opening an second instance of the workbench
on the same workspace.    Thanks!
Comment 4 John Arthorne CLA 2002-07-15 16:39:12 EDT
*** Bug 21589 has been marked as a duplicate of this bug. ***