• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how can we lauch browser from my application in solris ?

 
zainu Mehmood
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • 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
 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are off topic. However, you can use 'sh -c <command>', in this case.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks Mirko Bonasorte ,your one line has solved my problem
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • 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 ]
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic