Configurable Java Format
This is a fork of google-java-format with extended configurability. This project is not affiliated with Google.
Changes from the Original
-
Removed all plugins – this fork contains only the core formatter.
-
Added the
--widthoption to specify a custom page width. -
Supports setting options via environment variables.
Usage
# Help java -jar configurable-java-format.jar --help # Format java -jar configurable-java-format.jar --width=120 File.java # Format in place java -jar configurable-java-format.jar --width=120 -i File.java
Alternatively, options can be passed as environment variables:
export JAVA_FORMAT_WIDTH=120
java -jar configurable-java-format.jar File.java