Properly formatted code is essential for enhancing readability, maintainability, and collaboration within development teams.This article delves into several tools and methods for formatting Java code from the command line.Google Java Format is a powerful tool designed to enforce a consistent style guide for Java code, ensuring readability and adherence to standards.Artistic Style (Astyle) is a flexible and general-purpose code formatter that supports C, C++, and Java programming languages.After downloading Astyle, we can easily format our Java code by running a simple command in the terminalWe can format a single Java file by executing a simple command using idea.sh script.Each tool offers unique features to ensure your code adheres to consistent styling guidelines, making it more readable and maintainable.Downloadable source code is also available.This article provides a guide on how to format Java code using command line tools.Tools discussed in this article include Google Java Format, Artistic Style (Astyle), and IntelliJ IDEA‘s idea.sh script.