• 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

Creating a process from Java

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have a swing GUI from which i am calling a batch file using RunTime.exec() . That batch file will kill and restart the GUI. But when it kills the GUI it itself got killed. So GUI is not coming up. Please let me know how to overcome this issue?
 
Ranch Hand
Posts: 1252
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Karthikeyan Chandrasekaran:
Hi All,

I have a swing GUI from which i am calling a batch file using RunTime.exec() . That batch file will kill and restart the GUI. But when it kills the GUI it itself got killed. So GUI is not coming up. Please let me know how to overcome this issue?



Please share the code of Batch file so that we can check whether what you have coded in that program.

what do you mean by "restart the GUI" does that means starting the application from where it was called or restart the GUI.

If you want to restart the GUI from the scratch again then you have to simply write a line
java GUIApplicationClass

else otherwise let us see the code first.
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is actually pretty common with many Operating Systems. When a process gets killed, the operating system may go after it's children too.

There is no one answer that will work in all cases... but some options include have the child protect itself from kill signals, detach from parent by closing stdin and stdout, executing another script, etc.

Henry
 
Karthikeyan Chandrasekaran
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you let me know how to create a detached(from parent) independant process from java?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic