• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

running executable jars

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any one have any ideas how to run an executable jar within a running java program? I am trying to avoid creating an external process, i.e. calling Runtime.exec(). Is there a way to invoke it without having to explicitly instantiating a new JVM?
thx in advance
 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can't you just create a new instance of the main class in the jar from you own program or am I oversimplifying this problem?
e.g. if contents of jar are like:
MainProg.class
SomeClass.class
SomeOtherClass.class
Then call in your other application.
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Patrick,
Why are you trying to avoid creating a new process? I may be wrong but I thought only one instance of the JVM is active while any number of java applications are run?
on another thought couldn't you create a new thread out of the other application somehow? Do you have source for this other application you're trying to run?
 
reply
    Bookmark Topic Watch Topic
  • New Topic