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

Answer from Constantin Zagorsky on Stack Overflow
Top answer
1 of 3
30

Go to Eclipse's Preferences → Java → Code Style → Formatter and export the settings to an XML file via the Export All button (or Edit and then Export in dialog that opens up). Then open IntelliJ IDEA Settings → Code Style → Java, click Manage, and import that XML file by simply clicking Import.

As of IntelliJ IDEA 13, there is no possibility to import .settings/.prefs files directly.


Edit: IntelliJ can import the following Eclipse properties:

  • General
    • Right margin, Formatter on/off tags
    • Indentation
    • Indent size
    • Usage of ‘Tab’ character
    • Usage of Tab only for leading indentation (Smart Tabs)
    • Indent ‘case’ branches from ‘switch’
    • Indent class members
    • Keep comment at first column
  • Spaces (Java)
    • Before/after comma (as set for Eclipse method declaration parameters)
    • After comma in type arguments
    • Within array initializer braces
    • Within brackets (in array reference)
    • Within parentheses of: annotation, ‘for’, ‘if’, ‘catch’ ’while’, ’switch’, method, empty method, parenthesized expression, method call, type cast, ‘synchronized’
    • Before parentheses of: ‘try’, ‘for’, ’while’, ‘switch’, method, ’if’, ‘catch’, method, method call, ‘synchronized’.
    • After type cast
    • Around unary, assignment operators (if it’s set for ‘before’ and ‘after’ in Eclipse).
    • Before opening brace of: array initializer, ‘switch’
    • Before ‘?’ in conditional expression
    • Space before/after ‘:’ in conditional expression
    • Space around binary operators (a single Eclipse setting is mapped to multiple IntelliJ IDEA’s settings)
  • Blank lines
    • Around fields and methods
    • Before/after package
    • Before/after imports
    • Before method body
    • Keep blank lines in code (number of empty lines to preserve)
  • Wrapping
    • New line before: closing brace in array initializer, ‘else’ in ‘if’ statement, ‘finally’ and ‘catch’ in ‘try’ statement, binary operator (if wrapped)
    • New line after: opening brace in array initializer Special ‘else if’ treatment (compact ‘else if’)
    • Keep simple blocks in one line
    • Keep control statements in one line
    • Alignment of: array initializer expressions, arguments in method declarations and calls, field declarations, extends list, assignments, binary expressions, ‘throws’ clause, resources in ‘try’.
    • Brace style for: code blocks, methods and classes
  • JavaDoc
    • Enable JavaDoc formatting
    • Blank lines in JavaDoc
2 of 3
13

In the latest (2020) IntelliJ IDEA, if you have the "Eclipse interoperability" plugin installed, it's as simple as:

Settings > Editor > Code Style > Java > ⚙️ > Import Scheme > Eclipse XML Profile

Discussions

Formatting Code
Changing the formatting of code in Eclipse to match the formatting used in IntelliJ IDEA can be done by configuring the code style settings in Eclipse to match those of IntelliJ IDEA. Here are the general steps to achieve this: **Install a Formatter Plugin (Optional):** - There are some Eclipse plugins available that can help you format your code according to IntelliJ IDEA's style. One such plugin is the "Eclipse Code Formatter" plugin, which can be found in the Eclipse Marketplace. **Configure Eclipse Code Formatter:** - If you've installed the Eclipse Code Formatter plugin or a similar tool, configure it to use the IntelliJ IDEA code style. - In Eclipse, go to `Window` > `Preferences`. - Expand `Java` > `Code Style` in the left-hand menu. - Click on `Formatter`. - You can create a new profile or edit an existing one. - In the Formatter Profile window, you can define your formatting preferences to match IntelliJ IDEA's style. This may include settings like indentation, brace placement, and more. **Import IntelliJ IDEA Code Style Settings:** - If you have access to IntelliJ IDEA, you can export its code style settings and import them into Eclipse. - In IntelliJ IDEA, go to `File` > `Settings` (or `IntelliJ IDEA` > `Preferences` on macOS). - In the settings dialog, navigate to `Editor` > `Code Style`. - Select your desired code style (e.g., Java) and customize it if needed. - Click the "Export" button to save the code style settings to an XML file. **Import IntelliJ IDEA Code Style into Eclipse:** - Back in Eclipse, under `Window` > `Preferences`, expand `Java` > `Code Style`. - Click on `Formatter`. - In the Formatter Profile window, click the "Import" button. - Browse to the XML file you exported from IntelliJ IDEA and import it. **Apply the IntelliJ IDEA Code Style:** - After importing the settings, you can apply the IntelliJ IDEA code style to your Java files. - Select the Java file(s) you want to format or use it globally for all files. - Right-click on the selected file(s) or folder and choose `Source` > `Format`. **Save the Preferences:** - To make sure your settings are saved, click "Apply" and then "OK" in the Preferences dialog. Keep in mind that Eclipse and IntelliJ IDEA may have some differences in their code formatting options, so achieving an exact match may not always be possible. You may need to make some manual adjustments or compromises to get as close as possible to your desired code style. Additionally, you may need to install additional plugins or extensions in Eclipse to fully match the IntelliJ IDEA experience, as some features may not be available out of the box. More on reddit.com
🌐 r/eclipse
1
0
September 5, 2023
Import IntelliJ code style into Eclipse - Stack Overflow
I would like to know if it's possible and how to export my IntelliJ code style settings and import them into Eclipse. I know it's possible from Eclipse into IntelliJ but I want the other way around. More on stackoverflow.com
🌐 stackoverflow.com
June 22, 2017
is same Java style with Eclipse & intellij ?
i use intellij idea. my co-worker use eclipse. we are use this java style. but not correct source formatting. i try intellij import...fail install google-java-format plugin ...fail import eclipse.x... More on github.com
🌐 github.com
1
June 11, 2018
intellij idea - Import eclipse settings to intellijI - Stack Overflow
I've got a stack of eclipse settings for code format. Is there any way to import these into intellij? More on stackoverflow.com
🌐 stackoverflow.com
🌐
JetBrains
blog.jetbrains.com › home › intellij idea › intellij idea 13: importing code formatter settings from eclipse
IntelliJ IDEA 13: Importing Code Formatter Settings from Eclipse - The JetBrains Blog
January 31, 2014 - All you need is to export settings ... the Export All button.), and then open IntelliJ IDEA Settings → Code Style → Java, click Manage, and import that XML file by simply clicking Import....
🌐
Reddit
reddit.com › r/eclipse › formatting code
r/eclipse on Reddit: Formatting Code
September 5, 2023 -

How to change the formatting of Eclipse IDE code to match the IntelliJ IDE format?

For example, the formatting of Streams in Eclipse bothers me, and I'd like to make it the same as IntelliJ's.

My laptop is too weak to download IntelliJ.

Top answer
1 of 1
3
Changing the formatting of code in Eclipse to match the formatting used in IntelliJ IDEA can be done by configuring the code style settings in Eclipse to match those of IntelliJ IDEA. Here are the general steps to achieve this: **Install a Formatter Plugin (Optional):** - There are some Eclipse plugins available that can help you format your code according to IntelliJ IDEA's style. One such plugin is the "Eclipse Code Formatter" plugin, which can be found in the Eclipse Marketplace. **Configure Eclipse Code Formatter:** - If you've installed the Eclipse Code Formatter plugin or a similar tool, configure it to use the IntelliJ IDEA code style. - In Eclipse, go to `Window` > `Preferences`. - Expand `Java` > `Code Style` in the left-hand menu. - Click on `Formatter`. - You can create a new profile or edit an existing one. - In the Formatter Profile window, you can define your formatting preferences to match IntelliJ IDEA's style. This may include settings like indentation, brace placement, and more. **Import IntelliJ IDEA Code Style Settings:** - If you have access to IntelliJ IDEA, you can export its code style settings and import them into Eclipse. - In IntelliJ IDEA, go to `File` > `Settings` (or `IntelliJ IDEA` > `Preferences` on macOS). - In the settings dialog, navigate to `Editor` > `Code Style`. - Select your desired code style (e.g., Java) and customize it if needed. - Click the "Export" button to save the code style settings to an XML file. **Import IntelliJ IDEA Code Style into Eclipse:** - Back in Eclipse, under `Window` > `Preferences`, expand `Java` > `Code Style`. - Click on `Formatter`. - In the Formatter Profile window, click the "Import" button. - Browse to the XML file you exported from IntelliJ IDEA and import it. **Apply the IntelliJ IDEA Code Style:** - After importing the settings, you can apply the IntelliJ IDEA code style to your Java files. - Select the Java file(s) you want to format or use it globally for all files. - Right-click on the selected file(s) or folder and choose `Source` > `Format`. **Save the Preferences:** - To make sure your settings are saved, click "Apply" and then "OK" in the Preferences dialog. Keep in mind that Eclipse and IntelliJ IDEA may have some differences in their code formatting options, so achieving an exact match may not always be possible. You may need to make some manual adjustments or compromises to get as close as possible to your desired code style. Additionally, you may need to install additional plugins or extensions in Eclipse to fully match the IntelliJ IDEA experience, as some features may not be available out of the box.
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 206575559-How-to-Export-Code-Formatting-Configurations-to-Eclipse
How to Export Code Formatting Configurations to Eclipse – IDEs Support (IntelliJ Platform) | JetBrains
March 27, 2016 - I'm confused why we need the third party plug-in when IntelliJ can import. ... Importing Eclipse code style will convert supported options to IDEA formatter. Using the third-party Eclipse formatter plug-in invokes the same formatting engine as used in Eclipse which can support more options and provides exactly the same results as in Eclipse.
🌐
GitHub
github.com › krasa › EclipseCodeFormatter
GitHub - krasa/EclipseCodeFormatter: IntelliJ plugin - use Eclipse's code formatter directly from IntelliJ. https://plugins.jetbrains.com/plugin/6546 · GitHub
Set the value of Class count to use import with and Name count to use static import with in Settings | Editor | Code Style | Java | Imports for Idea 14 or Settings | Editor | Code Style | Imports for older Idea.
Starred by 514 users
Forked by 117 users
Languages: Java 93.9% | HTML 5.8% | JavaScript 0.3%
🌐
JetBrains
jetbrains.com › help › idea › configuring-code-style.html
Code style schemes | IntelliJ IDEA Documentation
1 month ago - Click Show Scheme Actions and select Import Scheme. Then select the necessary format. In the dialog that opens, select the file with the settings and click Open. Rename the scheme if necessary and select Current scheme to apply the settings ...
Find elsewhere
🌐
CodingTechRoom
codingtechroom.com › question › import-code-style-settings-intellij-eclipse
How to Import Code Style Settings from IntelliJ IDEA to Eclipse - CodingTechRoom
In IntelliJ IDEA, export the code style settings using the 'Export' command in the preferences. Convert the exported settings to a suitable XML format if required. In Eclipse, go to the preferences menu and import the settings using the 'Import' option under 'Code Style'.
🌐
DEV Community
dev.to › bassemibrahim › have-anyone-managed-to-format-code-in-intellij-just-like-eclipse-102g
Have anyone managed to format code in IntelliJ just like Eclipse? - DEV Community
April 17, 2019 - I have been using eclipse to format my code after each task for a while now. please heeelp! 😊😀 · And please don't tell me to switch to Eclipse. because I really like IntelliJ and got used to it. ... Have you tried adopting a 3rd party set of formatting rules that can work with both IDEs? I'm currently investigating the same thing for my team and a few people have recommended following Google's style guide, which comes with configuration for both eclipse and intellij: github.com/google/styleguide
🌐
GitHub
github.com › google › styleguide › issues › 369
is same Java style with Eclipse & intellij ? · Issue #369 · google/styleguide
June 11, 2018 - i use intellij idea. my co-worker use eclipse. we are use this java style. but not correct source formatting. i try intellij import...fail install google-java-format plugin ...fail import eclipse.x...
Author: google
🌐
Xwiki
dev.xwiki.org › xwiki › bin › view › Community › CodeStyle › JavaCodeStyle
Java Code Style - XWiki
August 3, 2026 - You can enable "Automatically add ... you want to document. ... Download codestyle-idea.xml. Go to IntelliJ's File > Settings and to Editor > Code Style and select Import Scheme > IntelliJ IDEA Code Style XML as shown on...
🌐
javathinking
javathinking.com › blog › export-intellij-idea-code-formatting-rules-to-eclipse
How to Export IntelliJ IDEA Code Formatting Rules to Eclipse: Generate Formatter XML — javathinking.com
Open both intellij-code-style.xml (IntelliJ’s export) and eclipse-baseline-formatter.xml (Eclipse’s baseline) in a text editor. Manually update Eclipse’s XML to match IntelliJ’s settings using the mapping table below: For a full list of mappings, refer to Eclipse’s Formatter Settings Documentation. Once you have eclipse-formatter.xml, import it into Eclipse to apply the rules:
🌐
ImageJ
imagej.net › imagej-wiki-static › Eclipse_code_style_profiles_and_IntelliJ
Eclipse code style profiles and IntelliJ - ImageJ
October 13, 2017 - A tutorial on IntelliJ plugins can be found here. After installing the ECF plugin you need to set it to use the Eclipse code styles file of the ImageJ project:
🌐
Openmrs
wiki.openmrs.org › display › docs › Developer+How-To+Setup+And+Use+IntelliJ
Developer How-To Setup And Use IntelliJ - Documentation - OpenMRS Wiki
November 25, 2020 - Open the IntelliJ preferences like you did Developer How-To Setup And Use IntelliJ#intellij-code-format ... We are using the the Developer How-To Setup And Use IntelliJ#eclipse-imports which are different from IntelliJ's! So make sure that you change the "Import Layout" to match the configuration as shown above. You will need to move the "Import static all other imports" to the top followed by a blank line, then "import javax.*", "import java.*" another blank line and then "import all other imports".
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 206824895-Import-Code-Style-Settings-from-Eclipse-
Import Code Style Settings from Eclipse? – IDEs Support (IntelliJ Platform) | JetBrains
November 28, 2008 - An import of eclipse style settings is very important for cross IDE teams. What would be more useful would be to EXPORT the IDEA style to the eclipse format so we can force our standards on them If the core team are not prepared to do this, what would it take to make it a plugin? ... Hello opticyclic, IDEA code style settings are stored in fairly simple XML files. Shouldn't be difficult to convert into something else, with either a plugin or a standalone tool.
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 206927945-importing-Eclipse-code-style-file
importing Eclipse code style file... – IDEs Support (IntelliJ Platform) | JetBrains
May 20, 2005 - My new company is using Eclipse and have standardized on a code style that will prevent a format war in the VCS. Imports are optimized. Spacing and tabs are defined. All that kinds of stuff. As everyone but me is on Eclipse they simply have some eclipse files that they all use.