Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change intellij's imports from inline to global?

I recently started using IntelliJ and have really been enjoying it but something that has driven me crazy is that for some reason imports all are inline! For example in the blow code:

// No imports yet
public class Hello {
    public void main() {
        ArrayList<String> newList = new ArrayList<>();
    }
}

Here because ArrayList isn't imported it is highlighted red, yet when I go click alt-enter on it, what happens is:

// No imports yet
public class Hello {
    public void main() {
        java.util.ArrayList<String> newList = new ArrayList<>();
    }
}

So it only inlines the import and only does so to one of them. How do I change the behavior so that IntelliJ imports the line at the top instead?

Help much appreciated!

like image 624
Samuel Jackson Avatar asked Jul 24 '17 22:07

Samuel Jackson


1 Answers

This behavior is controlled by the Use fully qualified class names setting in the Java Code Style, Imports tab.

use FQCN

like image 79
CrazyCoder Avatar answered Oct 06 '22 23:10

CrazyCoder