JDK-4210168 : Add a system method for launching the user's default browser
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.1.7,1.4.1,5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic,windows_xp
  • CPU: generic,x86
  • Submitted: 1999-02-09
  • Updated: 2005-08-24
  • Resolved: 2005-08-24
Related Reports
Duplicate :  
Relates :  
Description
Name: dbT83986			Date: 02/09/99


I subscribe to several Java development mailing lists for various platforms.
One question that comes up alot is how to best use Runtime.exec() to pass a URL
to  the Netscape browser. Now, on UNIX and Windows platforms, one can pass in a 
String containing the URL as one of the parameters, or just pass in the URL as 
part of a command-line flag( i.e.: 'Runtime.exec("netscape -remote  http://my.url.com")');
however, on Macintosh, command-line flags are not 
supported. Apple's Java porting team has worked around this issue by having 
their implementation of the runtime parse the parameters, and if the parameter 
looks like a URL, they send a "gurl" AppleEvent to the browser, which tells it 
to load the URL. 

Since this seems to be the most common use of Runtime.exec(), it would be a 
nice feature to have an exec method which accepts a URL object (this would make 
life easier for the Apple folks, at least - they could just have their 
implementation send the "gurl" event when Runtime.exec() is called with a URL object as a 
parameter). In this way, developers could simply pass in a URL object (which 
may have been constructed for some other reason in their application) to invoke 
the browser with. 

This way, the platform-dependent implementation could just
get the URL string from the URL object and pass it appropriately
to the browser.
(Review ID: 43562)
======================================================================

Comments
EVALUATION There's an interesting idea here if you think about it as something like System.launchBrowser(URL what); rather than as a warped version of Runtime.exec. There is a real need for programs to be able to find the user's default browser (if one exists) and cause a given URL to be displayed in it. We should see how much demand there is for this and proceed accordingly. -- mr@eng 1999/2/19 This feature should be considered for Tiger. -- iag@sfbay 2002-03-22 The functionality proposed by this RFE has been implemented as a subset of RFE 6255196. See the description of that RFE for API details.
22-03-2002