I am trying to run a binary file, which is Genia Sequence Splitter through java code. This Binary file is type x-executable and has no extension. I can run the file in terminal by using ./geniass arg1 arg2
where arg1 is input file arg2 is output file
I want to automate this process. I tried using this code
public class geniaSSTag {
public static void geniaSS(String inputFile){
System.out.println("Input file: "+inputFile);
String[]cmd={"bash","geniass/./geniass","in.txt","out.txt"};
try {
String errOutput="";
Process process = Runtime.getRuntime().exec(cmd);
String s = "";
BufferedReader br = new BufferedReader(new InputStreamReader(process
.getInputStream()));
while ((s = br.readLine()) != null)
{
s += s + "\n";
}
System.out.println(s);
BufferedReader br2 = new BufferedReader(new InputStreamReader(process.getErrorStream()));
while (br2.ready() && (s = br2.readLine()) != null)
{
errOutput += s;
}
System.out.println(errOutput);
} catch (IOException ex) {
Logger.getLogger(geniaSSTag.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
But I get this error when I try to run
geniass/./geniass: geniass/./geniass: cannot execute binary file
How can I solve this. Any help is appreciated.
Thank you