I know these libraries for Java:
-
JEuclid (MathML renderer; Apache License)
-
JLatexMath (Latex renderer; GNU License) improved JMathTeX
-
JMathTeX (Latex renderer; GNU License)
-
HotEqn (Latex renderer; GNU License ?)
-
SnuggleTex (Latex renderer; BSD License)
For the animation part of your question, you can look at these projects:
-
DragMath equation editor (Swing interface; GNU License)
-
Mirai Calc calculator (SWT interface; GNU License; uses JMathTeX)
-
Java Swing Equation builder
For a web interface you can also use the jsMath JavaScript or it’s successor Mathjax library as a Latex/MathML renderer.