As far as I know, EJS can work with MathLab (as GUI front for mathlab).
But you need to generate .m file with mathlab (not with java)

EJS is a java code generator, so it can generate java output.
Mathlab is a commerical product, you should use mathlab to generate .m file.