How do I change the code convention in Eclipse

code511788465541441 picture code511788465541441 · Dec 17, 2010 · Viewed 8.1k times · Source

I like to use curly brackets in this fashion

void hello()
{
    code();
}

When I press Ctrl + Shift + F in Eclipse it changes everything to

void hello(){
    code();
}

Answer

Gábor Lipták picture Gábor Lipták · Dec 17, 2010

Window/Preferences/Java/Code style/Formatter view:

Create a new profile based on the eclipse built in, then go to braces tab and change "same line" to next line everywhere. Then set the new profile to default.