• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Help with Runtime.exec()

 
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello. I am launching a java app from within another java app.
Here is the code I am using to launch to app:

When this runs, it brings up the app OK.
Now, when I add the lines of code to set the parameters in the main
method of the app being launched and try to run it, nothing happens.
Here is the main method of the app being launched:

What am I doing wrong?
Thanks!
 
Ranch Hand
Posts: 8946
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried your suggestion (Here's my code):

and still nothing is coming up. Any other ideas?
Thanks!
 
Pradeep bhatt
Ranch Hand
Posts: 8946
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like there is some error
Add this

If it prints 0 => the process runs fine
non-zero=>There is a error
[ September 23, 2003: Message edited by: Pradeep Bhat ]
 
Pradeep bhatt
Ranch Hand
Posts: 8946
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried running a simliar program and it worked fine.
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jennifer,
I'm not sure that you'll be able to come up with a platform independent use of Runtime.getRuntime.exec() to run another Java application. I've read from more than one resource that its use is not recommended.
(I'm not sure that the following "solution" is necessarily a good idea, but you might want to try it out.) Perhaps invoking the main method just as if it were any ol' method will do the trick.
[ October 02, 2003: Message edited by: Dirk Schreckmann ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic