Java-Applet to access Maxima



Thank you Rupert, thank you Jaime.

I'm not really a computer expert. So (maybe) this is really a silly question...

I found this (and a few lines more) to let Java execute tp commands:

Process p = Runtime.getRuntime().exec("maxima -q --batch-string='(2+1)*4;'");

Java says that the programm cannot be run. No such file or directory is existing.

It won't work without installing Maxima on the server. Am I right? What do I have to do exactly?

Thank you!
Rene




Am 14.06.2010 um 17:36 schrieb Rupert Swarbrick:

> Jaime Villate <villate at fe.up.pt> writes:
>>> I'm writing a Java-Applet where you can type in an expression
>>> (e.g. "(2+1)*4"). I'd like to send this expression to Maxima. Maxima
>>> should calc the result and give it back to my Java-Applet.
>> 
>> Try this:
>>  maxima -q --batch-string="(2+1)*4;"
>> your Java applet will have tp execute commands like that one and then
>> parse the output to extract the answer.
> <snip>
> 
> ... but be careful. Sending arbitrary strings from the internet to
> maxima is a bad idea unless the maxima process has no privileges to
> break anything: Using the ":lisp (foo)" convention, together with
> whatever command your lisp implementation uses to call other programs,
> would let the user run arbitrary code with the privileges of the maxima
> process.
> 
> Rupert