title: how to apply Eclipse Java code style formatter
body: <p>I try to apply eclipse google style formatter to existing codes, but failed. I am using eclipse luna, Java 8 and windows 8. </p>
  
  <p>I import eclipse Google Java style templates. I enabled the project specific settings. However when i try to follow /0/ using command window and invoke command /1/. I got error /3/. I try to add /2/ into my copied file: com.google.gdt.eclipse.suite.prefs. It show same error.</p>
  
  <p>Any hints? Or shall I use other tool, such as Jalopy or JIndent?</p>
  
  <p>/0/</p>
  
  <pre><code>http://www.peterfriese.de/formatting-your-code-using-the-eclipse-code-formatter/
  </code></pre>
  
  <p>/1/</p>
  
  <pre><code>C:\eclipse_luna_nemuNew_gwt_gradle_scala\eclipse\eclipse.exe -vm "C:\Program Files\Java\jdk1.8.0_40\bin\java.exe" -application **org.eclipse.jdt.core.JavaCodeFormatter** -verbose -config C:\sjj\GeneralTest\lib\org.eclipse.jdt.core.prefs C:\sjj\GeneralTest\src\main\java\com\callstats\general\exer\jackson\*.java
  </code></pre>
  
  <p>/2/</p>
  
  <pre><code>org.eclipse.jdt.core.compiler.compliance=1.5
  org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
  org.eclipse.jdt.core.compiler.source=1.5
  </code></pre>
  
  <p>/3/</p>
  
  <pre><code>!SESSION 2015-10-20 19:20:52.563 -----------------------------------------------
  eclipse.buildId=4.4.2.M20150204-1700
  java.version=1.8.0_40
  java.vendor=Oracle Corporation
  BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
  Framework arguments:  -product org.eclipse.epp.package.standard.product -application **org.eclipse.jdt.core.JavaCodeFormatter** -verbose -config C:\sjj\GeneralTest\lib\org.eclipse.jdt.core.prefs C:\sjj\GeneralTest\src\main\java\com\callstats\general\exer\jackson\ConInfo.java C:\sjj\GeneralTest\src\main\java\com\callstats\general\exer\jackson\JacksonExample.java C:\sjj\GeneralTest\src\main\java\com\callstats\general\exer\jackson\JSONUtil.java C:\sjj\GeneralTest\src\main\java\com\callstats\general\exer\jackson\User.java
  Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.standard.product -application **org.eclipse.jdt.core.JavaCodeFormatter** -verbose -config C:\sjj\GeneralTest\lib\org.eclipse.jdt.core.prefs C:\sjj\GeneralTest\src\main\java\com\callstats\general\exer\jackson\ConInfo.java C:\sjj\GeneralTest\src\main\java\com\callstats\general\exer\jackson\JacksonExample.java C:\sjj\GeneralTest\src\main\java\com\callstats\general\exer\jackson\JSONUtil.java C:\sjj\GeneralTest\src\main\java\com\callstats\general\exer\jackson\User.java
  
  !ENTRY org.eclipse.osgi 4 0 2015-10-20 19:20:54.784
  !MESSAGE Application error
  !STACK 1
  java.lang.RuntimeException: Application "**org.eclipse.jdt.core.JavaCodeFormatter**" could not be found in the registry. The applications available are: org.eclipse.ant.core.antRunner, org.eclipse.ant.ui.antRunner, org.eclipse.e4.ui.workbench.swt.E4Application, org.eclipse.e4.ui.workbench.swt.GenTopic, org.eclipse.equinox.app.error, org.eclipse.equinox.p2.director, org.eclipse.equinox.p2.garbagecollector.application, org.eclipse.equinox.p2.publisher.InstallPublisher, org.eclipse.equinox.p2.publisher.EclipseGenerator, org.eclipse.equinox.p2.publisher.ProductPublisher, org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher, org.eclipse.equinox.p2.reconciler.application, org.eclipse.equinox.p2.repository.repo2runnable, org.eclipse.equinox.p2.repository.metadataverifier, org.eclipse.equinox.p2.artifact.repository.mirrorApplication, org.eclipse.equinox.p2.metadata.repository.mirrorApplication, org.eclipse.equinox.p2.updatesite.UpdateSitePublisher, org.eclipse.equinox.p2.publisher.UpdateSitePublisher, org.eclipse.equinox.p2.publisher.CategoryPublisher, org.eclipse.help.base.infocenterApplication, org.eclipse.help.base.helpApplication, org.eclipse.help.base.indexTool, org.eclipse.jdt.apt.core.aptBuild, org.eclipse.jdt.core.JavaCodeFormatter, org.eclipse.jdt.core.JavaIndexer, org.eclipse.pde.build.Build, org.eclipse.pde.junit.runtime.uitestapplication, org.eclipse.pde.junit.runtime.legacytestapplication, org.eclipse.pde.junit.runtime.coretestapplication, org.eclipse.pde.junit.runtime.coretestapplicationnonmain, org.eclipse.pde.junit.runtime.nonuithreadtestapplication, org.eclipse.ui.ide.workbench, com.google.gwt.eclipse.core.GWTCodeFormatterApplication, org.eclipse.emf.codegen.CodeGen, org.eclipse.emf.codegen.JMerger, org.eclipse.wst.jsdt.core.JavaCodeFormatter.
      at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:248)
      at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
      at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
      at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
  </code></pre>
  
  <p><strong>Updated</strong> 
  <br/>
  </p>
  
  <p>@Sean Patrick Floyd, @Michael: You two are awesome. 
  Your suggestion is correct. And I notice there is no org.eclipse.jdt.core.prefs in Eclipse Luna version, instead there is: com.google.gdt.eclipse.suite.prefs.
  Inside of file com.google.gdt.eclipse.suite.prefs, there is two lines /5/.</p>
  
  <p>Right now, in each file, when I try ctr+shift+f, I got existing file formatted. 
  When I try /4/, the code style sounds like Eclipse default code style. Why could not I apply google style to existing java files?</p>
  
  <p>/4/</p>
  
  <pre><code>C:\eclipse_luna_nemuNew_gwt_gradle_scala\eclipse\eclipse.exe -vm "C:\Program Files\Java\jdk1.8.0_40\bin\java.exe" -application org.eclipse.jdt.core.JavaCodeFormatter -verbose -config C:\sjj\GeneralTest\lib\com.google.gdt.eclipse.suite.prefs C:\sjj\GeneralTest\src\main\java\com\callstats\general\exer\jackson\*.java
  </code></pre>
  
  <p>/5/</p>
  
  <pre><code>eclipse.preferences.version=1
  id=1433316730347
  </code></pre>