• 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Start a script ( where a server is defined) from a java application

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have a problem. I have an sc.exe application and 2 scripts (host.sc, client.sc). From command line they can be started like:
sc -c 'read host.sc'
sc -c 'read client.sc'

the problem is that I want to start the server from a java aplication and I do it like this:

try {
p = Runtime.getRuntime().exec("sc.exe -c \'read tool.sc\'");
} catch (IOException e1) {
// TODO
e1.printStackTrace();
}
and it works fine. The client I start from the command line. what happens is that the comunication between them fails. After the TCP/Ip connection is done it somehow fails...or it is never established corectly?!?
The other way around it works just fine (client atrted from java and server from commnd line).
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It appears that you have not made provision for handling the output streams resulting from the exec of the sc.exe program. Read the Javadocs for java.lang.Process

Bill
 
Hey cool! They got a blimp! But I have a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic