[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: octave from java

From: George Kousiouris
Subject: Re: octave from java
Date: Fri, 15 Apr 2011 12:18:37 +0300
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv: Gecko/20110303 Thunderbird/3.1.9


are you sure you are capturing output and error streams efficiently? There are many ways to do that, the most stable (we have tested it for hours of execution of octave through Java) is raising threads in order to capture output and error streams. You can find more info in the following link:

You can also use java to octave library (, for parsing some info from java to octave.

We have also made a stable service oriented implementation of octave execution through web services and java. You can find an initial version of the code here:

that illustrates the usage of threads in order to raise octave executions and capture efficiently output and error streams.

hope it helps,

On 4/15/2011 11:47 AM, frank buloup wrote:

I'm trying to use Octave from java but I'm facing a strange problem that have already been encountered. From java program, I'm using Runtime exec to start an external process, getting back input, output and error streams; sending command using output stream and parsing the result from input stream. Everything is working fine until a bad command is sent to Octave (a command containing a call to a function from a package that has not been installed for instance) : octave seems to crash
and I 've not found any log file that could help me to debug something.

This problem has already been encountered, please see thread :

Two points are mentioned from this thread :

1) Something has already been done in python using pipes or sockets - At the begining of the thread 2) Using Runtime exec approach, you must use "--interactive" option and read data in bytes - At the end of the thread

My questions :

1) Is anybody know how to use pipes or sockets and can give me some links, starting points
that could help me ?

2) I did not understood the read "data in bytes". There is no ByteBufferedReader class and from a BufferedReader there exist only a read(char[],offset,length) method, but it reads chars,
not bytes !!! Must we use a BufferedInputStream instead ?

Thanks a lot for your help,
Help-octave mailing list



George Kousiouris
Electrical and Computer Engineer
Division of Communications,
Electronics and Information Engineering
School of Electrical and Computer Engineering
Tel: +30 210 772 2546
Mobile: +30 6939354121
Fax: +30 210 772 2569
Email: address@hidden

National Technical University of Athens
9 Heroon Polytechniou str., 157 73 Zografou, Athens, Greece

reply via email to

[Prev in Thread] Current Thread [Next in Thread]