Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

IntelliJ IDEA has a built-in feature to eliminate unutilized imports automatically before committing changes. Here are the steps to configure this feature:

  1. Open IntelliJ IDEA and go to the "Version Control" panel on the right side of the window.
  2. Click on the "Configure" button next to the Git repository you want to configure.
  3. Select the "Code" tab and enable the "Optimize imports on the fly" option.
  4. Click on the "Apply" button to save the changes.

Now, IntelliJ IDEA will eliminate unutilized imports automatically when you commit changes to the Git repository.

You can also configure IntelliJ IDEA to eliminate unutilized imports manually by following these steps:

  1. Open the Java file you want to remove unutilized imports from.
  2. Press the "Ctrl" + "Alt" + "O" keys on Windows or "Cmd" + "Alt" + "O" keys on Mac to open the "Optimize imports" dialog box.
  3. Select the "Remove unecessary imports" option and click on the "Run" button to remove unutilized imports.

You can repeat these steps for all Java files in your project to eliminate unutilized imports.