The JDT has a commandline Eclipse Application that allows users to format Java source code either with the Eclipse default code formatter options or with custom options.
Running the Formatter Application
CodeFormatter