Is there a way to generate a eclipse code formatter xml which matches Intellij IDEA code formatting rules?
Asked
Active
Viewed 4,609 times
12
-
Were you able to figure this out? I've got the same issue. I'm now working with a team that uses Eclipse and I need to export our company CodeStyles and Formatting for them to adopt. – mtpultz Apr 23 '15 at 06:44
-
Sorry. I couldn't find a way – Lahiru Chandima Apr 23 '15 at 07:14
3 Answers
2
If CheckStyle is an option for you, consider using it as 'single source of truth':
- create CheckStyle config
- install CheckStyle plugins in both Eclipse and IDEA
- import formatter configs from CheckStyle config
See answers to related question.
I haven't tried it yet.
1
At the moment there is no way to export IntelliJ code style to eclipse. You need to do it the other way around.
You can also check IntelliJ plugin called "Eclipse Code Formatter" (link), but it the same way, from Eclipse to IntelliJ.
I'm using IntelliJ 14.1.4

Albert Casanovas
- 254
- 1
- 7
0
Try this:
- In IntelliJ, File -> Settings -> Editor -> Code Style -> Java, click the gear icon then Export -> Eclipse XML Profile:
- In Eclipse, Window -> Preferences -> Java -> Code Style -> Formatter -> Import; ensure your imported profile is selected as the
Active profile
and Apply:
Screenshots are from IntelliJ IDEA 2022.3.2 (Community Edition)
and Eclipse 2022-03 (4.23.0)

MuffinTheMan
- 1,509
- 20
- 25