This paper presents a multi-language and multi-environment generation of nonlinear finite element codes. The system consists of two major components. The Mathematica package AceGen is used for the symbolic derivation of formulae needed in numerical procedures and automatic code generation. The Computational Templates package is a collection of prearranged modules for the automatic creation of the interface between the finite element code and the finite element environment. The AceGen and the Computational Templates packages together enable multi-language and multi-environment generation of nonlinear finite element codes from the same symbolic description. The approach implemented in AceGen avoids the usual problem of uncontrollable growth of expressions by combining several techniques: symbolic and algebraic capabilities of Mathematica, an automatic differentiation technique, automatic code generation, simultaneous optimization of expressions; and theorem proving by stochastic evaluation of the expressions.