This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help? Java Command Shell

 
Travis To
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did anyone has idea how to invoke an another application within Java (Java command shell)?
My goal, is to click a button, and a IE window will be invoked. I thinks i can run the 'iexplore' within a Java by the command shell.

thanks a lot
 
Darin Niard
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Travis To
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thx, But i just tried in JBuilder7 with
try{
Runtime.getRuntime().exec("iexplore www.google.com");
}
catch (Exception e){}

and when i run it, nothing happen
 
Travis To
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thx, But i just tried in JBuilder7 with
try{
Runtime.getRuntime().exec("iexplore www.google.com");
}
catch (Exception e){}

and when i run it, nothing happen
 
Darin Niard
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah... you need to specify the whole path with IE for some reason. Even using "cmd /c" doesn't work.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also google for "Java exec rundll32". There are more online examples than molecules in the universe. Well, almost. Feeding a filespec or URL to rundll32 is a lot like clicking a file in Windows Explorer. Windows will open the program associated with the extension or domain (http). This should open the user's default browser which may not be IE which may or may not match your user's expectations.
 
Tim West
Ranch Hand
Posts: 539
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to check out BrowserLauncher for this. Nice and cross-platform.


--Tim
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic