Robin's Blog
A remote-sensing PhD student talking about interesting things…
Show MenuHide Menu

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

November 15, 2011

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

9 Comments
ameen
February 16, 2012 at 6:08 am

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

ameen
February 16, 2012 at 6:58 am

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

Rahul
June 28, 2012 at 12:52 pm

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.:)

Douglas
November 1, 2012 at 6:16 pm

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

kurtz
November 7, 2012 at 1:45 am

Thanks

Asanke
February 12, 2013 at 11:30 am

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!!!

Ashqar
March 21, 2013 at 6:37 am

WOOOHOOO , thanks man that was awesome

Somu
April 22, 2013 at 10:43 am

Thanks a lot Robin. It worked for me.

May 15, 2013 at 10:17 am

Yes, It is worked. Thank You.

Leave a Reply

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