4

See the image, basically if I go to enter shift+[ or shift+] aka { or } in eclipse

I expect the editor to update the .java source with a { or }.

Instead it seems to be indenting...

Now I'm using a standard macbook pro, with English any ideas why eclipse won't let me enter the curly brace. It worked about 2 weeks ago, did an update... using Mountain Lion... now it's not working. enter image description here Any ideas?

2
  • Have you verified that you can enter the braces in any other program, such as the word processor? Commented Aug 12, 2012 at 7:25
  • Yep, that's what's really bugging me, everything else works fine. It's only Eclipse. Xcode, sweet. TextEdit, fine. Netbeans, all good. Eclipse...no Curly Brace functionality...making programming in Java close to impossible. Commented Aug 12, 2012 at 7:54

4 Answers 4

4

My solution was:

Help -> Key Assist then find skip Skip all Breakpoints.

Select it and press ctrl + shift + L. It will open a preferences window and then just delete binding.(ctrl + alt + b)

I hope it solved your problem!

3

enter image description here

Just delete the keys, simple. Hope it helps.

General->Keys->Type filter keys->skip  ->skip All Brakepoint->Bindings-> Delete
2

This behavior is controlled by the following preference.

Go to Preferences -> Java -> Editor -> Typing and confirm that the Automatically close -> Braces option is selected like so :

enter image description here

For what it's worth, I have never had the problem you have been experiencing on Mountain Lion OSX and for the past few days I have been switching between Eclipse Indigo, Helios and Juno.

If the above does not work, try switching to a new workspace and try there ? I am not aware of any other preference which might be controlling this brace-closing behavior.

Question : Which version of Eclipse are you on ?

4
  • I will see if I can't get a fresh install off the eclipse site and see if that helps. Unfortunately the braces tickbox is ticked. So the issue remains. Commented Aug 12, 2012 at 10:22
  • And a quick update. More bad news, I updated to the latest version of Eclipse Juno and the problem remains. Something must be up with the OS. Possibly a keyboard setting... but I have no real clue what the cause is right now. Frustrating! Commented Aug 12, 2012 at 10:49
  • It should not be something with the OS since I have the same setup. A new workspace did not work either ? Which version of Java are you using ? Commented Aug 12, 2012 at 11:30
  • I'm using Luna 4.4.2 and I could only get it fixed as pointed out by @Andriy .Seems like an internal Eclipse bug. The { Braces } option only works if you select it and Enter key adjusts the indentation on the new line as well. Tested it here, so, got to check both.
    – cbaldan
    Commented Jun 27, 2016 at 14:34
1

I had this problem in Eclipse Java EE for Web Developers Luna 4.4.1. Both of "Braces" options were selected. But it started to work properly only after selecting "Enter key adjust the indentation on the new line". Hope it will help someone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.