wood burning stoves 2.0*
The moose likes IDEs, Version Control and other tools and the fly likes How to format all java files as per Sun's or Eclipse Standards ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How to format all java files as per Sun Watch "How to format all java files as per Sun New topic
Author

How to format all java files as per Sun's or Eclipse Standards ?

Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 422
Hi,

Please advice on how to change all/ java related files in my project to Sun's or Eclipse Standards ?


OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16020
    
  20

There's a very nice app called Jalopy that can do bulk pretty-printing according to a very customizable set of rules, including the Sun ones. It can be run stand-alone from the command line or as a plug-in to Eclipse (and IntelliJ, for that matter).

However, I believe that if you right (menu) click in the Explorer view on the directory that contains the Java files of interest, select Source/Format, all of the Java files in that directory and its children will be run through the formatter. I do recommend making a backup first, though.


Customer surveys are for companies who didn't pay proper attention to begin with.
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Before using the "Source->Format" option, you need to be sure that it is set-up as you want it to be, and maybe you need to run the "Source->Clean Up..." options first - and then maybe you also want to perform a "Save Actions" each time you save your code....


Regards, Rene Larsen
Dropbox Invite
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to format all java files as per Sun's or Eclipse Standards ?