The template code is written in Python so must be run with the sandbox language set to Python and the Ace language set to Java. But there are other problems in your template as well, and there are some additional complications that I didn't warn you about involved in running Java, such as naming the source file to match the main class name and setting the memory limit to 0 (leaving memory management to the JavaVM).
I attach an XML export of a working (I hope) prototype for running Java programs via Python in a single Jobe run, provided the code compiles and there are no run time errors or timeouts. It must be imported using the Moodle XML file format.
My usual warnings applies: this hasn't had much testing and certainly hasn't been used in a production environment, since I don't teach Java any more.
Note that this is only for write-a-program questions, without any test code.