The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
August 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

exec call

Posted by Erich Teppan on October 22, 2001 at 8:44 AM

> Hi I'm trying to execute a jar file from another java program. But for some reason this doesnt work.
> try{
> Runtime.getRuntime().exec(
> "c:/pathname/java.exe -jar MyPgm.jar");
> }
> catch(IOException ioe){ioe.printStackTrace();}

> the above code just opens a dos window and quickly closes it.
> When i try executing that string in windows run it works but for some reason out of my java program it doesnt. Anyone know why??
> thanx






Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us