| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| <head> |
| <meta name="copyright" content= |
| "Copyright (c) Red Hat Incorporated 2006, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." /> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| <meta http-equiv="Content-Style-Type" content="text/css" /> |
| <title> |
| Running the Formatter Application |
| </title> |
| <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type= |
| "text/css" /> |
| </head> |
| |
| <body> |
| <h1> |
| Running the Formatter Application |
| </h1> |
| <p> |
| Running the formatter application is as simple as running the |
| org.eclipse.jdt.core.JavaCodeFormatter application from the commandline: |
| </p> |
| <pre> |
| eclipse -vm <path to virtual machine> -data <workspace> -application org.eclipse.jdt.core.JavaCodeFormatter [ OPTIONS ] <files> |
| |
| |
| </pre> |
| <p>When invoked on MacOS, the paths to point to the configuration file or the source files can be relative, but they will be computed |
| from the location of the eclipse.ini file. This is a limitation of the Eclipse launcher on MacOS. On all other platforms, the relative paths |
| are computed relative to the current user directory.</p> |
| <table border="1" cellspacing="0" cellpadding="5" width="600" summary=""> |
| <tr> |
| <td valign="top" width="25%"> |
| <p> |
| -data <workspace> |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| The formatter requires a workspace to run. The workspace folder does |
| not have to exist and can be removed after the formatter is complete. |
| The recommended flow is to specify a unique temporary folder and remove |
| it on completion. |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td width="25%"> |
| <files> |
| </td> |
| <td> |
| Java source files and/or directories to format. Only files ending |
| with .java will be formatted in the given directory. |
| </td> |
| |
| </tr> |
| </table> |
| <table border="1" cellspacing="0" cellpadding="5" width="600" summary=""> |
| <thead> |
| <tr> |
| <th> |
| <p> |
| OPTIONS |
| </p> |
| |
| </th> |
| <th> |
| <p> |
| Description |
| </p> |
| </th> |
| </tr> |
| </thead> |
| <tbody> |
| |
| <tr> |
| <td valign="top" width="25%"> |
| <p> |
| -config <file> |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| |
| Use the formatting style from the specified properties file. |
| Refer to <a href="tasks-232.htm">Generating a config file for the |
| formatter application</a> for details. |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" width="25%"> |
| <p> |
| -help |
| </p> |
| |
| </td> |
| <td valign="top"> |
| <p> |
| Display the help message. |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top" width="25%"> |
| |
| <p> |
| -quiet |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Only print error messages. |
| </p> |
| </td> |
| </tr> |
| |
| <tr> |
| <td valign="top" width="25%"> |
| <p> |
| -verbose |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Be verbose about the formatting job. |
| </p> |
| |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| |
| <h3 class="related">Related references</h3> |
| <a href= |
| "../reference/preferences/java/codestyle/ref-preferences-formatter.htm">Code |
| formatter</a> |
| </body> |
| </html> |