1

The issue in our team is that different developers use different IDEs and did not synchronize the settings, thus during every commit you can see that the order of the package imports changes which is quite annoying.

Most of the guys use Eclipse, but I would like to stay with Intellij IDEA, but don't want to import all the Eclipse settings.

Can I import/configure the settings only for the classpath import order?

Rufi
  • 2,529
  • 1
  • 20
  • 41
  • by `package import order` do you mean classpath order...? – Raja Anbazhagan Jan 27 '16 at 13:53
  • I assume that classpath would be the right word here, yes. I mean the order of imports in the beginning of the java files. – Rufi Jan 27 '16 at 14:02
  • 2
    No, I think he meant, that import statement at the beginning of the class are reordered in Eclipse (if set so). – Betlista Jan 27 '16 at 14:46
  • 1
    Check this - http://stackoverflow.com/questions/14716283/is-it-possible-for-intellij-to-organize-imports-the-same-way-as-in-eclipse – Betlista Jan 27 '16 at 14:48
  • @Betlista, you are right. I mean exactly that. The link looks good, thanks! – Rufi Jan 28 '16 at 07:22

1 Answers1

2

So, the solution was found. Thanks to @Betlista who provided a link to exactly the same question which I was not able to find myself.

So, the point is that it is possible to set the order of the imports manually thus if we know the Eclipse default order rules we can apply them.

Settings -> code style -> java -> imports

set "class count to use import with ''"* to 99 or more because it seems to be impossible to disable it and then set the order of Eclipse which is the following:

  • static all other,
  • blank,
  • java.*,
  • blank,
  • javax.*,
  • blank,
  • org.*,
  • blank,
  • com.*,
  • blank,
  • all other imports
Community
  • 1
  • 1
Rufi
  • 2,529
  • 1
  • 20
  • 41