Difference in behavior running in CLI and from a Java Program



Greetings,

I have a Java program feeding commands to an instance of Maxima  
spawned using Runtime.Exec().

When I enter the commands :

PolMat(P) := matrix(  [ 1, cos(2*P), sin(2*P), 0 ], [ cos(2*P), cos(P) 
*cos(P), sin(2*P)*cos(2*P), 0], [ sin(2*P), sin(2*P)*cos(2*P), sin 
(2*P)*sin(2*P), 0],[ 0, 0, 0,0 ] ) ;
integrate(PolMat(P), P ) ;

through this interface, it returns :

integrate(PolMat(P), p)

When I run the same two commands from the CLI, the integral is  
evaluated and I get :

             [                                             /      ]
             [               sin(2 P)         cos(2 P)     [      ]
             [     P         --------       - --------     I 0 dP ]
             [                  2                2         ]      ]
             [                                             /      ]
             [                                                    ]
             [             sin(2 P)                               ]
             [             -------- + P         2          /      ]
             [  sin(2 P)      2              cos (2 P)     [      ]
             [  --------   ------------    - ---------     I 0 dP ]
             [     2            2                4         ]      ]
(%o7)       [                                             /      ]
             [                                                    ]
             [                  2                          /      ]
             [   cos(2 P)    cos (2 P)     sin(4 P) - 4 P  [      ]
             [ - --------  - ---------   - --------------  I 0 dP ]
             [      2            4               8         ]      ]
             [                                             /      ]
             [                                                    ]
             [   /            /               /            /      ]
             [   [            [               [            [      ]
             [   I 0 dP       I 0 dP          I 0 dP       I 0 dP ]
             [   ]            ]               ]            ]      ]
             [   /            /               /            /      ]

Is there some difference in the environment variables when not  
running from a shell with the CLI ?

Thanks,

Chris