Ok this is a very small post, but if you look for this information through Google, for example, it’s hard to find an easy and clear answer. And here it is.
Assuming your eclipse path is /Applications/eclipse/eclipse, and the all the Java code (even in subdirectories) resides in /Users/lorenzo/sources/java_project/, the command is the following:
/Applications/eclipse/eclipse -vm /usr/bin/java -config /Users/lorenzo/mysettings/eclipse/org.eclipse.jdt.core.prefs -application org.eclipse.jdt.core.JavaCodeFormatter -verbose /Users/lorenzo/sources/java_project/*
Of course, this means that the “coding style” is described in the /Users/lorenzo/mysettings/eclipse/org.eclipse.jdt.core.prefs file. A research in your path will display an already existent one.
And, of course, it assumes that you have Eclipse installed.