You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Making any changes to eclipse formatter xml is not reflecting to actual format of java file #2738
The reason (seems to be) because the formatter.xml contents essentially gets put into the org.eclipse.jdt.core.prefs file now on first rebuild, and those take precedence (they didn't previously do this). And updates to formatter.xml do not put the changes back into said file.
You can remove all of the org.eclipse.jdt.core.formatter. lines within org.eclipse.jdt.core.prefs and it'll work as expected again, but those lines will come back on on rebuild.
@snjeza I believe that did it, thank you!! @SunnyRaj84348 resolved on your end too? It's worth mentioning to start fresh, I cleaned out all of the org.eclipse.jdt.core.formatter. lines myself from the within org.eclipse.jdt.core.pref, cleaned the workspace, and from then on out whatever was in my formatter.xml was what got used (And 'rebuilding' did not bring them back) I don't know if those lines would've cleared themselves out, nor if they were there if they would've been "ignored" for what's in the xml.
I had the same problem as @SunnyRaj84348. I have a custom formatter.xml file that I edit using Eclipse and then copy into my vs code project folder, but the formatting wasn't updating.
Updating to vscode-java pre-release did not fix it for me, but @tthornton3-chwy's solution of clearing out org.eclipse.jdt.core.formatter.* lines from .settings/org.eclipse.jdt.core.pref did, and my formatter settings take effect now. It's also worth mentioning that if you have a multi module project (as I do via maven), you'll also need to check each module subfolder for .settings/org.eclipse.jdt.core.pref and clear out the org.eclipse.jdt.core.formatter.* lines there as well.
Activity
tthornton3-chwy commentedon Oct 13, 2022
Thanks @SunnyRaj84348 , I was about to report the same!
The reason (seems to be) because the
formatter.xmlcontents essentially gets put into theorg.eclipse.jdt.core.prefsfile now on first rebuild, and those take precedence (they didn't previously do this). And updates toformatter.xmldo not put the changes back into said file.You can remove all of the
org.eclipse.jdt.core.formatter.lines withinorg.eclipse.jdt.core.prefsand it'll work as expected again, but those lines will come back on on rebuild.snjeza commentedon Oct 26, 2022
@SunnyRaj84348 @tthornton3-chwy Could you try VS Code pre-release?
tthornton3-chwy commentedon Oct 28, 2022
@snjeza I believe that did it, thank you!! @SunnyRaj84348 resolved on your end too? It's worth mentioning to start fresh, I cleaned out all of the
org.eclipse.jdt.core.formatter.lines myself from the withinorg.eclipse.jdt.core.pref, cleaned the workspace, and from then on out whatever was in myformatter.xmlwas what got used (And 'rebuilding' did not bring them back) I don't know if those lines would've cleared themselves out, nor if they were there if they would've been "ignored" for what's in the xml.Thanks again for your time here!
sjhobson commentedon Nov 29, 2022
I had the same problem as @SunnyRaj84348. I have a custom formatter.xml file that I edit using Eclipse and then copy into my vs code project folder, but the formatting wasn't updating.
Updating to vscode-java pre-release did not fix it for me, but @tthornton3-chwy's solution of clearing out
org.eclipse.jdt.core.formatter.*lines from.settings/org.eclipse.jdt.core.prefdid, and my formatter settings take effect now. It's also worth mentioning that if you have a multi module project (as I do via maven), you'll also need to check each module subfolder for.settings/org.eclipse.jdt.core.prefand clear out theorg.eclipse.jdt.core.formatter.*lines there as well.Thank you all for your help.
zrovihr commentedon Jan 18, 2026
this still a thing?