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

running external executables

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am executing another program (primegens.exe) file using ProcessBuiler() in my java code. this executable executes other executables (inside this) in a for loop like blastall.exe and primer3.exe depending on the side of input.

now when I run the Java code, it is hanged! if I terminate this external process manually then java code execute rest of it. interestingly the same executable primegens.exe works fine while running from MS command Prompt.
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your description gives me a general idea of what you are TRYING to do. However, you need to post some code in order for us for us to see what your program is ACTUALLY doing.

Layne
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Gyan Prakash Srivastava:
now when I run the Java code, it is hanged! if I terminate this external process manually then java code execute rest of it. interestingly the same executable primegens.exe works fine while running from MS command Prompt.



From the few bits of info you provide my guess is that primegens.exe writes to System.out and/or System.err until the output buffer is full and then gets stuck. The Java program that does the exec does not drain the two streams, but just waits for the process to finish --- deadlock.

Before Java does not get proper process control features, something like my http://www.ebi.ac.uk/~kirsch/monq-doc/monq/stuff/Exec.html may help.
[ October 14, 2005: Message edited by: Harald Kirsch ]
 
Evil is afoot. But this tiny ad is just an ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic