Jak możesz zaimplementować JavaScript do Java
Rhino is what you are looking for.
Annoying Ant
Rhino is what you are looking for.