Importing code style formatting settings into eclipse from intellij-idea

11,006

Solution 1

I couldn't find a ready plugin for that in 2018. So here is a side by side code style configuration from UI perspective of Intellij IDEA 2017.3 and Eclipse OXYGEN.3 March 2018. If both configured this way the code will be formatted close enough, so for example github will show you code differences so that it make sense.

For our project we configured one XML for each IDE so they more or less match:

  • IntelliJ Config File is default of IDEA 2017.3 so not much to define in XML - enter link description here
  • Eclipse Config is modified a bit from the default to match IntelliJ - link
  • Here is also a PDF file to show all the options set in both IDEs side by side - link

There is also a project to solve this problem across more IDEs(Answer) : EditorConfig

Solution 2

You can export settings in Intellij by clicking on File > Export Settings but they will be in .jar format.

According to this thread there is no easy way of importing settings.jar into eclipse.

Eclipse - import code format settings

I hope this helps :)

Solution 3

There is a EditorConfig - independent format for editors/IDEs code style configuration. There are EditorConfig plugins for most popular editors(see full list here).

You can see examples for IntelliJ IDEA(tutorial) and Eclipse(plugin page).

Share:
11,006
Luke_P
Author by

Luke_P

Updated on June 07, 2022

Comments

  • Luke_P
    Luke_P almost 2 years

    I've recently implemented the maven Check style plugging into my project and have changed all of the formater Settings in intellij (Which I use) to conform to this style guide (which they now do).

    However I need to produce a settings .xml file for eclipse, so that my colleagues can automatically format there code so that it also conforms to this style guide.

    The problem I am finding is that I cannot see a way of exporting the settings from intellij and importing them into eclipse. and I cannot manually configure eclipse to conform with the nuances of the new style guide (Continuation indentation being the main problem).

    Any help or Ideas would be fantastic. :)

  • Karthick Ramesh
    Karthick Ramesh about 4 years
    Welcome to SO. Though the link answers the question, It is better to add consolidated details out here so that the answer stands out even the link is broken in the future.
  • Pratik Chaudhari
    Pratik Chaudhari about 4 years
    Sure, I will take care of this from next time onwards.
  • Pandurang Patil
    Pandurang Patil over 3 years
    :D Liked the end comment... "I hope this helps :)"