Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable automatic Java static imports?

A recent version of IntelliJ (16+ EAP) started automatic Java static imports.

To be clear: I am OK with non-static imports.

Can I disable only static imports?

like image 448
kevinarpe Avatar asked Jan 26 '16 01:01

kevinarpe


2 Answers

In IntelliJ IDEA 2017.1.5, I solved this by increasing the numbers here:

Settings -> Editor -> Code Style -> Java ->
    Class count to use import with '*': 50
    Names  count to use static import with '*': 30
like image 150
John Berg Avatar answered Oct 25 '22 20:10

John Berg


There are checkboxes for controlling automatic importing at File | Settings | Editor | General | Auto Import. Now there's only one, but in the next EAP, there will be separate ones for class and method/field imports.

After IDEA 2016.2.1, it's controlled by Show import suggestions for static methods and field checkbox.

like image 40
Peter Gromov Avatar answered Oct 25 '22 18:10

Peter Gromov