• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how can we lauch browser from my application in solris ?

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i use
Runtime.getRuntime().exec("cmd /c start iexplorer http://www.sun.com");
it works fine for windows but what for solaris where netsacepe is insatalled ,please let me know
 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are off topic. However, you can use 'sh -c <command>', in this case.
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not in the scope of Sun Certified Java Programmer I think...
 
zainu Mehmood
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mirko Bonasorte ,your one line has solved my problem
 
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are using Java 6, you can and probably should use the new Desktop class. This has platform-independent pure Java browser launcher.

If you are not using Java 6, then you can still do better on Windows. You should respect the user's chosen browser, not force them to use Internet Exploder. You can do that by running FileProtocolHandler.

On Linux, you can use "htmlview". Might that work on Solaris? Again, has the advantage of respecting user's choice of browser.



Note 1: RuntimeOptions is not a built-in class, it's mine. You can see what it does.

Note 2: I've got Mac OS X code, too, but it's a bit more verbose, so I haven't included it here.
[ May 16, 2007: Message edited by: Peter Chase ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic