Robin's Blog

How to: Solve the ‘Ctrl-Space (auto-complete) not working’ problem in Eclipse

This problem is known by various names such as:

  • Ctrl-Space doesn’t do anything in Eclipse!
  • Why can’t I get auto-complete to work properly in Eclipse?
  • I’ve just set up a new University computer and things don’t work like they do on my laptop (maybe that one’s just me…)

It’s actually very simple to solve, but the problem is actually nothing to do with Eclipse. First of all, let’s see what the problem is:

You’ve just installed Eclipse, are starting to do some programming in it, and want to use the very handy auto-complete feature. So, you type part of a function name and press Ctrl-Space, waiting for the magic to work and the rest of the name to be automatically typed….but it doesn’t happen!

In the image above (which unfortunately doesn’t include the cursor) I had typed ST, and pressed Ctrl-Space to autocomplete it but nothing happened.

When trying to fix this myself, I went in to the Eclipse options (Windows->Preferences, then General->Keys) and tried to find the command for auto-complete. Helpfully, it’s not called autocomplete or anything like that – it’s called Content Assist. This showed me that, as I expected, Content Assist was assigned to Ctrl-Space:

So why wasn’t Eclipse picking this up? I tried setting the key for Content Assist manually, but when I deleted the text in the key binding box and pressed Ctrl-Space, it showed that only Ctrl registered – somehow the spacebar press was being ‘eaten up’ by something else. What could it be?

The simple answer is: the Windows language services utility – obvious really! This seems to be set by default (at least some of the time) to switch between languages by using Ctrl-Space. On my personal computer I only have one language set up (English (UK)), but on the university computers there are loads – French, German, Italian, Chinese (simplified) etc. You can find out what languages you have set up by going to Control Panel -> Region and Language -> Keyboards and Languages (tab) and then Change Keyboards (again, how obvious…). You’ll see a list of languages installed – remove any that you don’t want (click the language and then click the Remove button) until you only have the ones you want left. That fixed it for me, but you can also check the Advanced Key Settings tab to make sure that none of the keyboard shortcuts that are set include Ctrl-Space.

Once you’ve done that, Ctrl-Space should work nicely


Categorised as: Computer Help, Computing, IDL, Python, Windows


10 Comments

  1. ameen says:

    I have the same problem here, using win7, same problem with all versions of ecclipse,tried helios, ganymede, indigo, but wont budge. I have tried all the above options, (tried removing all keyboards, removed all key associations from advanced tab, everything possible) but still ctrl+space not working for me, i think some other program has hijaked my keys, can you please let me know how to find out which program is using up my ctrl + space

  2. ameen says:

    Hi Dude,.. THANK GOD FIXED IT, i restarted the machine after doing all the above steps, now its working fine

  3. Rahul says:

    Thank you very much.. Have been struggling Since I installed eclipse on win 7.

    At last thanks to you, I am again in love with win 7.:)

  4. Douglas says:

    Thanks dude, you saved my life!
    I’ve been trying to solve it for days, now it’s working!!

  5. kurtz says:

    Thanks

  6. Asanke says:

    Thanks a Mill.
    In my case My eclipse was working fine on Ubuntu 10.04 and I did an upgrade to 12.04LTS. With the upgrade the CRTL+Space has been assigned to a system task.

    How to:

    just type ‘ibus-setup’
    home:$ ibus-setup
    Under General tab –. Keyboard shortcuts find ‘CRTL+Spcae’ defined.
    Change it to something else Ex: CTRL+ALT+Space
    Apply and close.
    You are done!!!

  7. Ashqar says:

    WOOOHOOO , thanks man that was awesome

  8. Somu says:

    Thanks a lot Robin. It worked for me.

  9. SARAV says:

    Yes, It is worked. Thank You.

  10. Govardhan Reddy says:

    Excellent. It is working fine. Because of this I have faced lot of issue and impact on my development. Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>