Hi,
i was mistaken the executable is not running and it giving following error while running:-
/home/nakul/Desktop/srilm/bin/i686/ngram-count: 1: Syntax error: Bad function name
try
{
String[] args = {"/bin/sh","/home/nakul/Desktop/srilm/bin/i686/ngram-count","-text", s,"-order","2","-write","EngC.count","-unk"};
p1=Runtime.getRuntime().exec(args);
OutputStream st1=p1.getOutputStream();
System.out.println( "");
System.out.println(st1);
//jTextArea2.append(toString(st1));
int i=p1.waitFor();
int j=p1.exitValue();
if(j==0)
{
System.out.println("Command Successful");
}
if(i == 0)
{
System.out.println(i);
jTextArea1.append("\n");
/*String[] args1 = {"/bin/sh",
"-c",
"ls /home/nakul/Desktop/srilm/bin/i686/Englm.lm -al"};
p2=Runtime.getRuntime().exec(args1);*/
//jTextArea1.append("Language Model created...");
//p2.wa
BufferedReader in = new BufferedReader(new InputStreamReader(p1.getInputStream()));
while ((kk = in.readLine()) != null) {
}
in.close();
}
else
{
BufferedReader stdErr = new BufferedReader(new InputStreamReader(p1.getErrorStream()));
// read the output from the command
while ((s = stdErr.readLine()) != null) {
System.out.println(s);
}
}
}catch(Exception e){
System.out.println(e);
}
So before the executable produce intermediate results first of all it must be running.
Please tell how to solve this problem....