Formatting Java code from command line

Single line for formatting Java classes using Eclipse in CLI

eclipse -nosplash \
  -application org.eclipse.jdt.core.JavaCodeFormatter \
  -verbose \
  -config ~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs \
  MyClass.java

Leave a comment

Your comment