You can try running the formatter as a standalone application (also more details here ).
eclipse -vm <path to virtual machine> -application org.eclipse.jdt.core.JavaCodeFormatter [ OPTIONS ] <files>
eclipse IDE, , eclipse.exe.
. " Formatter"
eclipse [...] -config <myExportedSettings>
java- :
Geo , , DefaultCodeFormatter
String code = "public class geo{public static void main(String[] args){System.out.println(\"geo\");}}";
CodeFormatter cf = new DefaultCodeFormatter();
TextEdit te = cf.format(CodeFormatter.K_UNKNOWN, code, 0,code.length(),0,null);
IDocument dc = new Document(code);
try {
te.apply(dc);
System.out.println(dc.get());
} catch (MalformedTreeException e) {
e.printStackTrace();
} catch (BadLocationException e) {
e.printStackTrace();
}
, . , Geo !
Thorbjørn Ravn Andersen :
Maven2 Java Formatter Plugin v0.4 maven, Maven Eclipse.
0.4, Eclipse 3.5, Java 8.