We're almost done! All that remains is to write a small batch file and run it:ĬD \eclipse_4.2 REM the folder of your Eclipse installationĮclipse.exe -application .JavaCodeFormatterĭ:/eclipse/workspace/AngularFaces/AngularFaces_1.0/AngularFaces-core/src/ If you're using a fresh eclipse installation, you may have to add the path of your JVM and the Java version, as described in Peter's post. To keep things simple I assume you're using the same eclipse.ini you're always using. Open the navigator view of eclipse and copy the file to a new location (or leave it where it is and just memorize the path name). Now the configuration rules have been added to. To do so activate project specific preferences as shown in the hardcopy:ĭon't forget to activate them again in the consecutive dialog: You'll have to make it project specific to get hold of the configuration file. I suppose you've already configured your source code formatting rule in the preference dialog of Eclipse. I already mention the configuration file, and that's what we're looking for next. Find the configuration fileīack to Eclipse 4.2. If you do, please drop a note in the comment section below so other readers can benefit from your effort. Either you use his Eclipse 3.6 distribution, or investigate some time to update it to a current Eclipse version. Unfortunately, Eclipse 4.2 uses different file names, and they seem to have changed the format of the configuration file. Stefan Franke shows you which libraries you need, and he even prepared a package based on Eclipse 3.6 for you. All you need is the formatter class, plus the infrastructure it needs. A down-sized version of EclipseĪctually, you don't have to install an entire Eclipse. In both cases it's unlikely Eclipse is already installed on your server. ![]() Of course you already have Eclipse on your development machine, so you can skip this point unless you want to run the formatter on your continuous integration server (aka Cruise Control, Jenkins or Hudson, or you want to run it each time a file is checked in. ![]() There are also quite a few great source code formatting tools out there (just think of Jalopy), but I assume you're an Eclipse user who simply wants to use the Eclipse configuration you've investigated so much time in. The general idea is to use Eclipse itself to do the formatting. Of course you're invited to read on instead and learn some additional hints. So, if you want to know how to format an entire Java Eclipse project in no time, you may ask Peter Friese. Considering how much Eclipse has changed since 2007 that's pretty astonishing. Today I've dug out an Eclipse 3.2 article that's seven years old and is still valid.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |