Is it possible to force IntelliJ to order imports alphabetically? So it should add import in lexicographical order and sort all imports that are not in good order when formatting the code.
Reformatting code optimizes the imports by default, but it is also possible to invoke Code | Optimize Imports
separately. You can configure the order of imports under Preferences | Editor | Code Style | Java
under the Import Layout
header. By default imports are alphabetically ordered, except for java.*
and javax.*
imports.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With