help-octave
[Top][All Lists]
Advanced

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

Trying to run octave under a java application


From: RafaelCruz
Subject: Trying to run octave under a java application
Date: Tue, 18 Mar 2014 09:20:51 -0700 (PDT)

Hi fellows! 

I'm trying to run a java application under a Debian server and, the said
application, should call octave, run a .mod program under it (dynare is
installed and bounded correctly).

This application works just fine on windows: it's able to run octave by the
followin syntax:

[code]
Process p = rt.exec("C:\\Octave\\3.6.4\\bin\\octave.exe --eval \"cd " 
                                        + actingFolder + "; dynare code.mod; 
save -text saida.txt; exit\"");
InputStream in = p.getInputStream();

while(in.read != -1);
[/code]

However I have no such luck bu running it on my debian server:

[code]

Process p = rt.exec(new String[]{"/bin/bash", "-c", "/usr/bin/octave",
"--eval", "cd " 
                                                                        + 
actingFolder + "; dynare code.mod; save -text saida.txt; exit",
"--silent"});

InputStream er = p.getErrorStream();

String saida = "";
                        
while(er.available() == 1)
        saida += (char)er.read();
                        
                        
System.out.println("Erro resultante : " + saida);

[/code]


Why isn't my code running on linux? Am I missing something?



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Trying-to-run-octave-under-a-java-application-tp4663155.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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