Note that it uses the jdk.compiler module to parse the Java source code. The java binary version used must therefore be from a JDK (not JRE) with a version equal to or newer than the Java language ...
I have the google java format plugin active, and "reformat code" and "optimize imports" active on save. According to the plugin documentation "When enabled, it will replace the normal Reformat Code ...