aspose file tools*
The moose likes Beginning Java and the fly likes Help? Java Command Shell Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help? Java Command Shell" Watch "Help? Java Command Shell" New topic
Author

Help? Java Command Shell

Travis To
Greenhorn

Joined: Jun 15, 2004
Posts: 5
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

Joined: Jun 08, 2004
Posts: 118
Travis To
Greenhorn

Joined: Jun 15, 2004
Posts: 5
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

Joined: Jun 15, 2004
Posts: 5
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

Joined: Jun 08, 2004
Posts: 118
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

Joined: Jan 29, 2003
Posts: 8791
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.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Tim West
Ranch Hand

Joined: Mar 15, 2004
Posts: 539
You may want to check out BrowserLauncher for this. Nice and cross-platform.


--Tim
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help? Java Command Shell