I'm try to run: java -jar /home/user/workspace/maltparser-1.8/maltparser-1.8.jar This is work. And return:
-----------------------------------------------------------------------------
MaltParser 1.8
-----------------------------------------------------------------------------
MALT (Models and Algorithms for Language Technology) Group
Vaxjo University and Uppsala University
Sweden
-----------------------------------------------------------------------------
Usage: java -jar maltparser-1.8.jar -f <path to option file> <options> java -jar maltparser-1.8.jar -h for more help and options
help ( -h) : Show options
----------------------------------------------------------------------------- option_file ( -f) : Path to option file
----------------------------------------------------------------------------- verbosity *( -v) : Verbosity level debug - Logging of debugging messages error - Logging of error events fatal - Logging of very severe error events info
- Logging of informational messages off - Logging turned off warn - Logging of harmful situations
-----------------------------------------------------------------------------
Documentation: docs/index.html
And now, I'm try to run this .jar from my class:
public class Main {
public static void main(String[] args) throws IOException, InterruptedException {
Process ps = Runtime.getRuntime().exec(new String[]{"java","-jar","/home/user/workspace/maltparser-1.8/maltparser-1.8.jar"});
ps.waitFor();
java.io.InputStream is=ps.getInputStream();
byte b[]=new byte[is.available()];
is.read(b,0,b.length);
System.out.println(new String(b));
}
}
And it return me nothing... I want to intercept output stream. How I can do it?