JDK-4317487 : RFE: Preventing multiple application instances when launching an application
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.3.0
  • Priority: P5
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2000-02-29
  • Updated: 2001-06-11
  • Resolved: 2001-06-11
Related Reports
Relates :  
Description

Name: rlT66838			Date: 02/29/2000


java version "1.2.2"
Classic VM (build JDK-1.2.2-W, native threads, symcjit)

This feature request also applies to J2SDK, SE v1.3 [RC1]

It is a common requirement (particularly in corporate environments) when
launching applications that only one instance of a given application be able to
be run at a time.

Currently if the java command (or its javaw variant) is executed multiple times
for a given application it simply launches multiple instances of that
application.

The java command (and in particular its javaw variant) should be changed to
include an additional command-line option which would allow the specification
that only one instance of the application should be run at a time.

In the case of the Windows javaw command if this option was specified and the
application was already executing, control would pass to the application
instance already executing (and if necessary reactivate the application if it
had been minimised to the Windows task bar).

Inclusion of this improvement to the java/javaw command would make application
deployment easier and the acceptance of Java into the corporate application
environment.
(Review ID: 101834) 
======================================================================

Comments
PUBLIC COMMENTS .
10-06-2004

EVALUATION fred.oliver@East 2001-06-05 This bug refers to functionality which is typical of Windows C programming style. This request refers to desktop GUI issues rather than processes and JVM management, such as locating a window which may belong to an application and assigning focus. I am transfering this to AWT. This is not an AWT bug; there are already several ways to do this, none of which have anything to do with AWT (see workaround section). I'm closing this out as will not fix, since the workarounds are more than adequate. michael.martak@Eng 2001-06-11
11-06-2001

WORK AROUND Several solutions to this problem exist, all within the realm of the standard JDK. First, one can use the RMI registry to advertise / lookup the application so that multiple instances can be prevented. If RMI is too heavy for this type of application, this can be done with basic sockets. Finally, falling short of even having network support, the application programmer can use JNI with native mutexes. michael.martak@Eng 2001-06-11
11-06-2001