i found a poor solution to my problem.
i went to the project and removed the
.settings directory and restarted eclipse. in the process i lost all my other formatting rules of course, which is why it sucks. but the blank lines are no longer are added, and the behaviour i described is the default behaviour (probably why i was used to it).
i still hope to accept a better solution for this, i have kept the old settings around to verify any suggestions.
edit: i think i've found the problem.
for some reason, possibly related to the project settings being checked out, any settings which i selected through preferences were not actually being honoured. so although the preferences suggested by von c were right, changing to them had no effect. i had the same problem trying to change the auto-generated comments, but didn't put two and two together (what actually alerted me to this was finally seeing "argh" being generated within a comment i couldn't seem to remove :-p).
so in this case, the problem was not actually the settings, but something else within eclipse i don't even want to investigate.
strange, i cannot reproduce that behavior with my own formatter profile (eclipse3.5.1).
there was a setting back in 2003 (bug 38523) to "insert new line after each parameter if line is too long", but this has been integrated into the "line wrapping" panel a long time ago.
are you sure the newlines are not added because of a wrapping issue (due to a maximum line length too short)?
the tab "blank lines" does have an "existing blank lines" section, with a "number of empty lines to preserve" field which can be set to 1, and should address the later part of your requirements.
in that same tab "blank lines", check also the value of the "before field declarations": "1" could explain the blank lines you see.
the formatter options are in the
org.eclipse.jdt.ui.prefs file, which is:
- either in your workspace (.metadata.plugins\org.eclipse.core.runtime.settings)
- or in the
.settingsof your project.
you can try and empty that file to check if the problem remains. it that clear up the issue, try adding some lines into that file, up to the point where the problem comes back.
.............................. 17jan2020 just remove the blank line after first field declaration. ..............................
the eclipse i am using is:
eclipse java ee ide for web developers.
version: indigo service release 2
build id: 20120216-1857
as the picture above shows, there is a 'between import groups' under the blank lines tab and it works for me. you can check it out.
- How to configure Eclipse formatter to not insert blank line between field declarations?
- Set Eclipse not to insert blank lines between methods declaration in interfaces?
- How to configure code Formatter in Eclipse to add new line after each element in enum?
- How to stop Eclipse from inserting blank line between import groups in Java code
- Eclipse Formatter add blank line between code blocks
- How to stop Eclipse formatter from placing all enums on one line
- How to force the Eclipse Mars 4.5 formatter not to join already wrapped lines?
- How to make Eclipse Formatter to not destroy commented out code?
- Does anyone know how to configure eclipse NOT to copy font colors / background when doing CTRL+C
- How to configure Eclipse to always launch the last run configuration, not the current file?
- Eclipse formatter : add blank line at the end of the class
- How to configure Eclipse to automatically insert import statements for classes with a single package match
- How to configure Eclipse not to delete the content of the classes folder on compile?
- how to configure eclipse run configurations for System Properties (ssl/tls) in command line arguments
- How to insert line comments in code programmatically in Eclipse
- How to configure line wrapping for imports in eclipse
- How to make Eclipse formatter put a new line after arrays in a type annotation declartion?
- How to configure Eclipse Formatter to add this. in front of class members
- How to prevent Eclipse formatter from inserting spaces at the beginning of line comment
- Configure enum constants on its own line using Eclipse Code Formatter
- How to make Eclipse not insert Content Assist suggestion
- How to stop Eclipse making new line between array instantiation and its values ( Ctrl + Shift + F)?
- How to insert new line just after method and type annotations using Eclipse JDT code formatter?
- eclipse + WDT + liberty: how to configure eclipse to not create the "WebSphere Application Server Liberty" project?
- Eclipse Formatter - how to avoid blank lines and spaces?
- Eclipse Formatter does not shutdown if started from command line
- How to configure eclipse formatter to run only when there are no compile errors
- How do I configure Eclipse and Maven to not duplicate folder listings?
- how to insert new line in eclipse using Preference and formatter?
- Cannot figure out how to properly configure eclipse formatter
More Query from same tag
- Eclipse with m2e not building tests
- google-java-format eclipse plugin ignoring formatter:off comments
- Eclipse Zend Debugger PhP installation error
- How can I test commands in Python? (Eclipse/PyDev)
- not getting required return value
- using libgdx 1.1, how to import a project on eclipse
- Primefaces Rendering issue
- I want to get GridPane's index when I act click event
- GStreamer cant be resolved error in eclipse
- The DFS browser cannot browse anything else but a distributed file system
- JMenu appearing behind JFrame
- Why does Gradle need a settings.gradle file?
- How to start sonar analysis against a tag/version of a project?
- Debugging remote application in eclipse?
- Eclipse Android Change API Level
- Building workspace creating a prob in eclipse for android app
- How to compile .java file in war directory of eclipse project?
- Max value of Xmx and Xms in Eclipse?
- hasNextLine() always returns false
- Error in android apps development in eclipse
- Why won't STS / m2eclipse track my Maven dependencies?
- Concentric circles with colors in java
- Communication between Eclipse plugins
- Need assistance with getCartTotal()
- Building curl in eclipse
- Eclipse launch error when trying to run an Android app
- When connecting Galaxy S2 to Eclipse LogCat begins to throw out errors like crazy
- Getting Started with Betfair's Java Streaming API
- Multiplication Field in Java / SceneBuilder
- Exporting jar from eclipse with classpaths...How do you do it?