How to launch a web browser from a MAC java app

I know, this topic has been brought up over, and over, however I couldn't find info regarding MAC environments. I don't have any former experience with MAC, but now I'm getting desperate for a solution. I need to be able to pop up the default browser showing a certain URL on MAC/OS from a java application. Any clue would be appreciated.
Thanks a lot,
michael berdan

I wrote libraies that will do this:
http://ostermiller.org/utils/Browser.html
I also keep a list of other resources to help you out:
http://dmoz.org/Bookmarks/D/deadsea/Java_Help/Web_Browser/
Stephen

Similar Messages

  • How to open a web browser from an windows phone app

    Hi everyone,
    I am pretty new to Windows Phone 7, and now what I am trying to do is to create a simple app. When a user click to start this app, a browser will open and show the content of a webpage from a specific address.
    I tried to use a webbrowser object, but it seems like that doesn't sport cookies. So I need my app to open a real web browser (maybe IE mobile) to do the job.
    Thank you.

    copying from stackoverflow: "If you want to embed a browser window inside your application then use  the WebBrowser control.  Add an instance of the WebBrowser control to  your form then you can reference it in code using the name you
    give  it.  (Default name is "webBrowser1")"
    Microsoft MVP J# 2004-2010, Borland Spirit of Delphi 2001

  • How to open a web browser from java

    Hi
    Would anybody please help me with this. I need to open a web browser from my java app but I don't know. What method I can use?
    Thanks.
    Hung.

    You can use the Runtime class for this. It can run any command. So, you can run the .exe file of your Web browser.
    The following code will run Internet Explorer (assuming iexplorer.exe is in C:\Program Files\Internet Explorer):
    import java.lang.Runtime;
    public class Explore{
    public static void main(String[] args) {
    try{
    Process p = Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\iexplore");
    }catch (Exception e) {
    System.out.println("Exception: " + e);

  • How can I launch a web browser from my Java application?

    I've reed about this at Question of the Week (http://developer.java.sun.com/developer/qow/archive/15/index.html). It doesn't work for me. I'm running win2000 and trying:
    try {
    Runtime.getRuntime().exec("start iexplore http://java.sun.com");
    } catch (Exception e) {
    System.out.println( e.getMessage() );
    I get:
    CreateProcess: start iexplore http://java.sun.com error=2
    What's wrong?

    This function will launch the default browser under Windows.
    public static void displayURL(String url) throws IOException   {
        String cmd = null;
        Process p;
        try  {
            String os = System.getProperty("os.name");     
            if (os != null && os.startsWith("Windows")) {
                if (os.startsWith("Windows 9") || os.startsWith("Windows Me"))  // Windows 9x/Me
                    cmd = "start " + url;
                else // Windows NT/2000/XP
                    cmd = "cmd /c start " + url;
                p = Runtime.getRuntime().exec(cmd);     
        catch(IOException x)        {
            // couldn't exec browser
            System.err.println("Could not invoke browser, command=" + cmd);

  • Any new ideas for launching web browser from application

    I have searched the forums trying to find a new way of launching a web browser from a java application. The problem I am having is that on Unix and Linux systems, at least the variety I have access to (not quite sure on what that variety those are as they are not my systems or systems I control), the common method of using Runtime.getRuntime().exec(STRING) with either netscape or mozilla does not work. While using the Runtime.exec method is not the same as a console, I did try on these systems "netscape + A_WEB_ADDRESS" (or mozilla) and it did launch the respective browser with the page, so it appears that at least from the console level, those commands are valid.
    All the forums seem to say that the Runtime.exec method is the way to go. All the source code I have found through links from the forum say the same thing. I have voted on this bug:
    http://developer.java.sun.com/developer/bugParade/bugs/4210168.html
    and the feedback there does seem to indicate that there is similar trouble out there. Below is the code I am using. It does work on Win2000,XP, and Mac OSX. The application is not supported on earlier systems, and as it stands it will not work on Win 95,98, nor ME. Only small modification should be needed for work on those OSs, but as I no longer personally use those OSs, I cannot be sure.
    private void openNativeBrowser(String url) {
    // not the browser itself is started, i only call something like
    // start http://www.javasoft.com
    // and then the standardbrowser will be started ...
    StringBuffer call = new StringBuffer();
    System.err.println(System.getProperty("os.name"));
    System.err.println(System.getProperty("user.dir"));
    try {
    // which OS ?
    String operatingSystem = System.getProperty("os.name");
    // how to call the OS
    if (operatingSystem.toLowerCase().indexOf("windows") > -1)
    call.append("cmd /c start ").append(url);
    else
    if (operatingSystem.toLowerCase().indexOf("mac") > -1)
    call.append("open ").append(url + " &");
    else if(operatingSystem.toLowerCase().indexOf("linux") > -1)
    // use Script 'netscape'
    call.append("mozilla ").append(url).append(" &");
    else
    call.append("netscape ").append(url).append(" &");
    System.err.println(call.toString());
    // start it ...
    Runtime.getRuntime().exec(call.toString());
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    As I said, if you have a new way to call the broswer that seems to work on either Unix or Linux, please post it, point to it, or explain it.
    Aaron

    there is a shell script on Linux called htmlview that you can launch like this:
    String[] cmd = {"htmlview", "http://java.sun.com"};
    try {
        Runtime.getRuntime().exec(cmd);
    } catch (IOException ioe) {
        // do something
    }which will open the default browser. Don't think this is available on other *NIX though, although the script itself would probably work so you could include it with your app (/usr/bin/htmlview).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Closing Web Browser from an Applet

    Does anyone knows how to close the Web Browser from an Applet ?
    Also Is there a way to close a browser which is intantiated from using ApplteContext ().showDocument ("....","_Blank").
    Thanks
    Sohan

    Hi kavinjir!
    Using class netscape.javascript.JSObject is possible to interact with javascript which can easily close the window browser but I'm afraid about the newest one because it isn't a child window. If this newest window contains an applet both (applets) can interact and send/receive "messages" to trigger an event (e.g; close via javascript again).
    Best Regards.

  • Launch a default web browser from my java application

    Hello,
    I have been trying to launch my default web browser from my java application, but am unable do it. Right now, I am using ---- "Runtime.getRuntime().exec("cmd /c start <url>"); to launch my webbrowser. It launches the browser but displays the command prompt for a second or so, and then replaces my already existing page with the new url.
    Is there any way for me to launch the url in a completely new browser each and every time. And I don't want the command prompt to show up for a sec. Please help...!
    Thanks in advance.
    -BusyBusyBee

    If by any chance your application is an Applet, you can use this to open a new browser window:
    getAppletContext().showDocument(new URL(theUrl), "_blank");
    But, you probably would have specified if that were the case. Oh well. Hope it helps someone!
    -sheepy.

  • How to open web browser from midlet on emulator

    Hi,
    I am using Java ME Platform 3.0 SDK. I want to open web browser on emulator.
    What should I do?
    Thanks.

    Hi,
    web browser is not a part of the emulator. The first think you have to do is to download mobile web browser. If you have mobile web browser downloaded go to Java ME SDK 3.0. There is Device Selector window in the bottom left corner. In this window you can see all emulators available in Java ME SDK 3.0. Choose an emulator you want to use and right click on it. In popup menu select "Run JAR or JAD..." action, in file chooser browse you mobile web browser and open it. That's all.

  • How to access a web service from a XLet

    Hello,
    I am new in software development to ITV and I dint find too many usefull information teaching how to access a web service from a XLet running in a STB. Are there anybody who can give me some help, maybe sample or tutorial?
    Gratefull
    David

    hi,
    you can "borrow" the source code from [Yambo a free soft open source presentation engine (AKA XML microbrowser Xlet )|http://www.cineca.tv/labs/mhplab/index-en.html] both local and on a http remote connection.
    hope it helps..
    bye
    andrea

  • How to call a Web Api from from a Visual webpart code behind?

    Hi,
    I am trying to create a visual web part in sharepoint 2013 with data received from another Web API.
    I followed the below steps.
    1. Created a Visual Web part.
    2. In the code behind(.cs) file I wrote the following code.
     async private void GetResult()
                using (var client = new HttpClient())
                    client.BaseAddress = new Uri("http://localhost:8080/");
                    client.DefaultRequestHeaders.Accept.Clear();
                    client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                    var response = await client.GetAsync("api/Tfs/OpenEnquiriesCount");
                    var content = response.Content;
    3. When I run the application, I get security exception in the line await
    client.GetAsync()
    What is the way to achieve this? How to call a web api from share point visual web part?
    Thank you in advance.

    Hi,
    Thanks for your sharing.
    Cheers,
    Jason
    Jason Guo
    TechNet Community Support

  • How to call a web Service from Oracle Applications?

    Hi friends,
    I've posted this question on OA Framework forum , but may be it's more appropiated put it here. Sorry for do it again:
    It's about how to call a web service from a Form or a .sql (via Request) in Oracle Applications:
    Could you please explain here the detailed steps (with code example if it's possible) to invoke a webservice from Oracle Applications?.. how did yo do it...?
    I've read differents posts here and the 33097.1 metalink note (by the way, the first recommended link in this note is broken...), but there are lots of theorical concepts and no real examples to see how/from where invoke the WS
    I'll have to call one webservice (I suppose the customer will give me the interface implementation)...but I've never did it with Applications so that's why I ask you for all the detailed steps...
    I work with Forms 6i, Apps 11.5.10.2 and DB 9.2.0.7.
    Thanks a lot.
    Jose.

    Hello Jose,
    I did using java program to call BPEL web services in 11.5.10.
    I pasted below the metalink note for your reference (Note:250964.1)
    The idea is first write a java program to call the webservice (in my case it is calling an BPEL web service, so this may not help directly), test it.
    Then port the java program as specified in the note, so that you could call your web service through concurrent manager scheduler.
    Is this ok?
    Thanks
    Arun.
    ======================================================
    Checked for relevance on 25-Apr-2007
    Application Install - Version: 11.5.8 to 11.5.10
    Goal
    ====
    How to register and create a Java concurrent program for Oracle Applications
    Release 11i
    Solution
    ========
    1. Create your Java Concurrent Program (JCP) , using a text editor.
    /*===========================================================================+
    | Concurrent Processing Sample Code |
    | |
    | FILENAME |
    | Hello.java |
    | |
    | DESCRIPTION |
    | Sample Java concurrent program |
    | About the simplest possible program, just writes a message to the |
    | logfile and output file. |
    | |
    | HISTORY |
    | $Log$ |
    | |
    +===========================================================================*/
    package oracle.apps.fnd.cp.sample;
    import oracle.apps.fnd.cp.request.*;
    public class Hello implements JavaConcurrentProgram {
    public static final String RCS_ID = "$Header$";
    public void runProgram(CpContext ctx) {
    ctx.getLogFile().writeln("-- Hello World! --", 0);
    ctx.getOutFile().writeln("-- Hello World! --");
    ctx.getReqCompletion().setCompletion(ReqCompletion.NORMAL, "");
    =======================================
    End Sample
    =======================================
    2. Create a sample directory under $JAVA_TOP:
    $ mkdir $JAVA_TOPoracle/apps/fnd/cp/sample
    3. Copy Hello.java into $JAVA_TOP/oracle/apps/fnd/cp/sample:
    $ cp $HOME/Hello.java $JAVA_TOP/oracle/apps/fnd/cp/sample
    4. Compile your java program:
    javac $JAVA_TOP/oracle/apps/fnd/cp/sample/Hello.java
    5. Test at the command line with following syntax:
    jre -Ddbcfile=$FND_TOP/secure/your_dbc_file.dbc \
    -Drequest.outfile=./outfile \
    oracle.apps.fnd.cp.request.Run \
    oracle.apps.fnd.cp.sample.Hello
    6. Register your custom java concurrent program with Oracle Applications.
    a. Navigate: Concurrent > Program > Executable
    b. Enter details into the form
    Executable: JCPHELLO
    Shortname: JCPHELLO
    Application: Application Object Library
    Execution Method: Java Concurrent Program
    Execution File Name: Hello (Insert a name that does not contain space or period)
    Execution File Path: oracle.apps.fnd.cp.sample
    c. Save the details
    d. Navigate: Concurrent > Program > Define
    e. Enter details into the form
    Program Name: JCPHELLO
    Program Shortname: JCPHELLO
    Application: Application Object Library
    Executable: Choose JCPHELLO from LOV
    Executable Options :
    f. Save the details
    7. Add this new concurrent request to your responsibility request group.
    a. Navigate > Security > Responsiblity > Request
    b. Query System Administrator
    c. Add new row and choose TestJava
    d. Save the changes.
    8. Run your new Hello Java Concurrent Program
    Navigate: Request > Run
    References
    ~~~~~~~~~~~
    Oracle Applications Developers Manual for Release 11i A75545-01
    ====================================================

  • Error of query launch in web Browser

    I test a standard query 0FIGL_VC1_Q0002, It's run well in BEx(Excel)
    But in BEx->Analyzer (SAP BW 3.x)->Tools->Launch in web Browser->Query(Default view) 
    I got an error page below.
    http://sapecc6:8000/&sap-client=800sap/bw/bex?sap-language=EN&CMD=LDOC&infocube=0FIGL_VC1&query=0FIGL_VC1_Q0002
    Service cannot be reached
    What has happened?
    URL http://sapecc6:8000/_sap-client=800sap/bw/bex call was terminated because the corresponding service is not available.
    Note
    The termination occurred in system ECC with error code 404 and for the reason Not found.
    The selected virtual host was 0 .
    What can I do?
    Please select a valid URL.
    If you do not yet have a user ID, contact your system administrator.
    ErrorCode:ICF-NF-http-c:000-u:SAPSYS-l:1-i:sapecc6_ECC_00-v:0-s:404-r:Notfound
    I feel the link address is not make sense. So I modified it
    http://sapecc6:8000/sap/bw/bex?sap-client=800&sap-language=EN&CMD=LDOC&infocube=0FIGL_VC1&query=0FIGL_VC1_Q0002
    After enter the modified link address in IE I can browse web report well.
    Hope someone give me some help. Thanks.
    ps:TCODE:SICF
    default_host->SAP->bw->Test Service is OK
    and the login address is http://sapecc6:8000/sap/bw/bex?sap-client=800
    Edited by: nono.lee on Feb 27, 2011 9:29 AM

    i Guess its something to do with your browser setting on your PC

  • How to debug ABAP Web services from Microsoft Visual Studio

    When developing .NET based Web services clients using Visual Studio that call Web services in SAP NetWeaver .NET developers would like to be able to debug inside SAP. In my blog <a href="/people/andre.fischer/blog/2007/02/07/how-to-debug-abap-web-services-from-microsoft-visual-studio to debug ABAP Web services from Microsoft Visual Studio</a> I would like to point .NET developers to the fact that SAP NetWeaver offers the option of external debugging to perform this task. Though the steps that have to be performed are described in the SAP Online Help I am sure that this option is not well known amongst the .NET developer community.

    Hello WilliamIV,
    >>How can I "configure" Visual Studio debugger to allow validation to work?
    Since I do not have a VS2012 environment, according to your provided link, I created a test demo with VS2013, however, both ways catch the validation error:
    If possible, you could have a try with VS2013 to see if it works or run the example on other machine with VS2012 to see if this is caused by the VS environment, in my side, I do not change any configuration, all are default.
    If I misunderstood this issue, please feel free to let me know.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to fetch only WebI reports from the repository

    How to fetch only WebI reports from the repository, where in we have Deski reports also in the repository.. any macro??

    here is the query to fetch only webi reports:
    Open Administration Launchpad (.Net / Java) from:
    Start >> All Programs >> BusinessObjects XI Release 2 >> BusinessObjects Enterprise >
    Click on the 'Query Builder' under 'Administration Tools' on the left pane.
    Logon to Query Builder using Enterprise Administrator credentials.
    Run the following query for Web Intelligence Reports:
    SELECT SI_ID, SI_NAME, SI_OWNER FROM CI_INFOOBJECTS WHERE SI_KIND='WEBI'
    Thanks,
    Srikanth.

  • Xmonad - prevent web browser from going "fullscreen"

    Hi,
    is there a possibility in xmonad to prevent an application (in my case the web browser) from resizing to fullscreen when it's the only window on a workspace? I have a huge display and do not want chromium to resize to the full resolution. I've done a lot of searching on this problem (and I can't believe that I'm the only one with this issue) but didn't find anything about that. Maybe because of my bad English...
    As mentioned in the title, the WM is xmonad.
    Thank you very much.

    Well, you could write a manageHook that tests if it is the only window on the screen, and if it is, changes the layout, or floats the browser with a spesific size

Maybe you are looking for

  • Need help with 'hover' text box

    Hola Why the 'hover' text box don't appear in this page? Welcome to TummyTime, 3D 4D Ultrasound, Modesto, Salida, Ceres, Turlock area. The 'hover' text should appear as you go over the pictures at the bottom of the page under  RECENT ANGELS section.

  • ORA-01940: cannot drop a connected user... No entries in v$session.

    Hi DBAs, Its on Linux Ubuntu... I want to drop a user. Getting error as below. When I check for connected sessions, I find no entries in v$session. Any other alternative? Please help!!! EGOVDBA@qadb> select * from v$version; BANNER Oracle Database 10

  • Individual purchase order with subcontracting material

    Hi all, I've implemented a individual purchase order in a sale order by means of 'TAB' category item. The material has been set as 'subcontracting'. When I create the sale order, a purchase requisition is automatically created with M imputation and s

  • My norton toolbar and identity safe are gone. How do I get them on firefox 4?

    Can I go back to earlier version of Firefox, or will this problem be resolved. All my password are on identity safe and I don't want to lose them.

  • OLE Automation: catch error message

    Hi, Experts. I am interested in catching error messages after OLE commands. I show it in Excel example, but interested in general: REPORT zlcka_ole . TYPE-POOLS ole2. DATA h_excel TYPE ole2_object. DATA h_workbooks TYPE ole2_object. DATA h_workbook T